diff src/data.c @ 3378:cb9eb3e46e2c

(Frem): Fix result sign properly.
author Richard M. Stallman <rms@gnu.org>
date Tue, 01 Jun 1993 03:37:28 +0000
parents 30b946dd8c66
children 36fe8e57f020
line wrap: on
line diff
--- a/src/data.c	Tue Jun 01 03:33:40 1993 +0000
+++ b/src/data.c	Tue Jun 01 03:37:28 1993 +0000
@@ -1762,7 +1762,8 @@
 #else
       f1 = drem (f1, f2);
 #endif
-      if (f1 < 0)
+      /* If the "remainder" comes out with the wrong sign, fix it.  */
+      if ((f1 < 0) != (f2 < 0))
 	f1 += f2;
       return (make_float (f1));
     }