X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/d7aff0d6929c16d15992304dd44c5f528df8f895..2fdec80c2cebf486bc708c5a59b0cd52def5285b:/src/floatfns.c diff --git a/src/floatfns.c b/src/floatfns.c index 9f0bab2a45..c68b9bd3a6 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -1,6 +1,6 @@ /* Primitive operations on floating point for GNU Emacs Lisp interpreter. -Copyright (C) 1988, 1993-1994, 1999, 2001-2013 Free Software Foundation, +Copyright (C) 1988, 1993-1994, 1999, 2001-2015 Free Software Foundation, Inc. Author: Wolfgang Rupprecht @@ -142,7 +142,7 @@ DEFUN ("tan", Ftan, Stan, 1, 1, 0, } DEFUN ("isnan", Fisnan, Sisnan, 1, 1, 0, - doc: /* Return non nil iff argument X is a NaN. */) + doc: /* Return non nil if argument X is a NaN. */) (Lisp_Object x) { CHECK_FLOAT (x); @@ -428,7 +428,9 @@ round2 (EMACS_INT i1, EMACS_INT i2) static double emacs_rint (double d) { - return floor (d + 0.5); + double d1 = d + 0.5; + double r = floor (d1); + return r - (r == d1 && fmod (r, 2) != 0); } #endif