[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: operation of 'round' function
From: |
Eli Zaretskii |
Subject: |
Re: operation of 'round' function |
Date: |
Fri, 08 Feb 2002 12:22:13 +0200 |
> From: David Kastrup <David.Kastrup@t-online.de>
> Newsgroups: gnu.emacs.bug
> Date: 07 Feb 2002 17:13:16 +0100
>
> So the doc string should be amended to read
> "Return the nearest integer to ARG. In case ARG lies equally close to
> the next and previous integer"
> and then we'd need the proper statement, something like
> a) "the behaviour depends on the floating point implementation of the
> underlying machine Emacs is running on"
> b) "the next even integer is chosen in compliance with IEEE
> arithmetic"
> c) "Emacs consults the variable rounding-direction which
> can take on the values 't, 'nil or 'randomly meaning..."
Thanks for the suggestions. The correct interpretation is a). I
fixed the doc string by borrowing what the ELisp reference already
says:
Rounding a value equidistant between two integers may choose the
integer closer to zero, or it may prefer an even integer, depending on
your machine. For example, \(round 2.5\) can return 3 on some
systems, but 3 on others.
The Emacs primitive simply calls `rint', which works according to the
current rounding mode.
Re: operation of 'round' function, Andreas Schwab, 2002/02/07