1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-01 09:51:22 -08:00

(Fmod): Fix the final adjustment, when f2 < 0 and f1 == 0.

This commit is contained in:
Richard M. Stallman 1995-05-07 09:02:39 +00:00
parent c5f48ce39e
commit e856a264dd

View file

@ -1949,7 +1949,7 @@ Both X and Y must be numbers or markers.")
f1 = fmod (f1, f2);
/* If the "remainder" comes out with the wrong sign, fix it. */
if ((f1 < 0) != (f2 < 0))
if (f2 < 0 ? f1 > 0 : f1 < 0)
f1 += f2;
return (make_float (f1));
}