math: rewrite modf.c and clean up modff.c