[Issue 9717] `std.math.round` rounds away from zero instead of to the nearest even integer

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Dec 2 08:56:26 PST 2015


https://issues.dlang.org/show_bug.cgi?id=9717

Infiltrator <lt.infiltrator at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lt.infiltrator at gmail.com

--- Comment #5 from Infiltrator <lt.infiltrator at gmail.com> ---
Both the C function[0] and the CRuntime_Microsoft version [1] actually
explicitly do rounding away from zero rather than to even.  There are other
functions in std.math which round using the current rounding mode, which
defaults to even, so this is most likely just a documentation error.


[0]: www.codecogs.com/library/computing/c/math.h/round.php#sec1
[1]: in std/math.d

--


More information about the Digitalmars-d-bugs mailing list