Commit 37ca9077 by Paul Eggert

### Fix porting inconsistency about rounding to even.

```* doc/lispref/numbers.texi (Numeric Conversions, Rounding Operations):
Document that 'round' and 'fround' round to even.
* src/floatfns.c (emacs_rint) [!HAVE_RINT]: Round to even.
This way, the unusual !HAVE_RINT case acts like the usual
HAVE_RINT case, and we can fix the documentation accordingly.```
parent 6a72e405
 2014-03-19 Paul Eggert Fix porting inconsistency about rounding to even. * numbers.texi (Numeric Conversions, Rounding Operations): Document that 'round' and 'fround' round to even. 2014-03-18 Juanma Barranquero 2014-03-18 Juanma Barranquero * customize.texi (Variable Definitions): Recommend avoiding * customize.texi (Variable Definitions): Recommend avoiding ... ...
 ... @@ -534,8 +534,7 @@ This returns @var{number}, converted to an integer by rounding upward ... @@ -534,8 +534,7 @@ This returns @var{number}, converted to an integer by rounding upward @defun round number &optional divisor @defun round number &optional divisor This returns @var{number}, converted to an integer by rounding towards the This returns @var{number}, converted to an integer by rounding towards the nearest integer. Rounding a value equidistant between two integers nearest integer. Rounding a value equidistant between two integers may choose the integer closer to zero, or it may prefer an even integer, returns the even integer. depending on your machine. @example @example (round 1.2) (round 1.2) ... @@ -803,6 +802,7 @@ returns that value as a floating-point number. ... @@ -803,6 +802,7 @@ returns that value as a floating-point number. @defun fround float @defun fround float This function rounds @var{float} to the nearest integral value, This function rounds @var{float} to the nearest integral value, and returns that value as a floating-point number. and returns that value as a floating-point number. Rounding a value equidistant between two integers returns the even integer. @end defun @end defun @node Bitwise Operations @node Bitwise Operations ... ...
 2014-03-19 Paul Eggert Fix porting inconsistency about rounding to even. * floatfns.c (emacs_rint) [!HAVE_RINT]: Round to even. This way, the unusual !HAVE_RINT case acts like the usual HAVE_RINT case, and we can fix the documentation accordingly. 2014-03-19 Eli Zaretskii 2014-03-19 Eli Zaretskii * w32fns.c (reset_modifiers): Zero out keystate[] before using it. * w32fns.c (reset_modifiers): Zero out keystate[] before using it. ... ...
 ... @@ -428,7 +428,9 @@ round2 (EMACS_INT i1, EMACS_INT i2) ... @@ -428,7 +428,9 @@ round2 (EMACS_INT i1, EMACS_INT i2) static double static double emacs_rint (double d) 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 #endif ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!