Different languages define the modulo operator differently when negative numbers are involved.
In emc2, MOD is defined to always have a positive result. It is defined in terms of the ISO C "fmod" function as follows ("*left" has a double role as the left-hand input and the result of the calculation): *left = fmod(*left, *right); if (*left < 0.0) { *left = (*left + fabs(*right)); } Jeff ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users