Project

General

Profile

Actions

Bug #12878

closed

0.49999999999999994.round is 1 and not 0 on Windows 64

Added by Eregon (Benoit Daloze) over 7 years ago. Updated over 7 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.1p112 (2016-04-26 revision 54768) [x64-mingw32]
[ruby-core:77794]

Description

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.

Updated by shyouhei (Shyouhei Urabe) over 7 years ago

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

Actions #2

Updated by nobu (Nobuyoshi Nakada) over 7 years ago

  • Status changed from Open to Closed

Applied in changeset r56534.


configure.in: no round in x64-mingw

  • configure.in (ac_cv_func_round): round(3) in x86_64-w64-mingw32
    is not accurate in an edge case. [ruby-core:77794] [Bug #12878]
Actions

Also available in: Atom PDF

Like0
Like0Like0