comparison 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
comparison
equal deleted inserted replaced
3377:68cd0dabfce7 3378:cb9eb3e46e2c
1760 #if defined (USG) || defined (sun) || defined (ultrix) || defined (hpux) 1760 #if defined (USG) || defined (sun) || defined (ultrix) || defined (hpux)
1761 f1 = fmod (f1, f2); 1761 f1 = fmod (f1, f2);
1762 #else 1762 #else
1763 f1 = drem (f1, f2); 1763 f1 = drem (f1, f2);
1764 #endif 1764 #endif
1765 if (f1 < 0) 1765 /* If the "remainder" comes out with the wrong sign, fix it. */
1766 if ((f1 < 0) != (f2 < 0))
1766 f1 += f2; 1767 f1 += f2;
1767 return (make_float (f1)); 1768 return (make_float (f1));
1768 } 1769 }
1769 #else /* not LISP_FLOAT_TYPE */ 1770 #else /* not LISP_FLOAT_TYPE */
1770 CHECK_NUMBER_COERCE_MARKER (num1, 0); 1771 CHECK_NUMBER_COERCE_MARKER (num1, 0);