new modff.c code, fix nan handling in modfl