Issue #12878 has been updated by Shyouhei Urabe.


JFYI if we stick to 64bit representation, 0.49999999999999994 is `0011111111011111111111111111111111111111111111111111111111111111`.

----------------------------------------
Bug #12878: 0.49999999999999994.round is 1 and not 0 on Windows 64
https://bugs.ruby-lang.org/issues/12878#change-61145

* Author: Benoit Daloze
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.3.1p112 (2016-04-26 revision 54768) [x64-mingw32]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
0.49999999999999994.round produces 1 on this platform, while all other platforms seem to produce the expected 0 (round-to-nearest).
Maybe this is due to some slightly different floating-point representation?

See https://ci.appveyor.com/project/eregon/spec-x948i/build/190/job/jk8eb1u2kq6npwn4 which reproduced it in a run of ruby/spec.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>