changeset 3378:cb9eb3e46e2c

(Frem): Fix result sign properly.
author Richard M. Stallman <rms@gnu.org>
date Tue, 01 Jun 1993 03:37:28 +0000
parents 68cd0dabfce7
children 68f28e378f50
files src/data.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
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));
     }