Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decimal->float non-monotonic conversion #5564

Closed
p6rt opened this issue Aug 12, 2016 · 4 comments
Closed

decimal->float non-monotonic conversion #5564

p6rt opened this issue Aug 12, 2016 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 12, 2016

Migrated from rt.perl.org#128913 (status was 'resolved')

Searchable as RT128913$

@p6rt
Copy link
Author

p6rt commented Aug 12, 2016

From zefram@fysh.org

"9.9989999999999991e0".EVAL < "9.998999999999999e0".EVAL
True

Observe that the literal with a greater nominal value yields a lower
Num value. (The .EVAL circumlocution is required to work around [perl
#​128820].) This implies that at least one of the literals is getting
incorrect rounding, which was the subject of [perl #​128912]. (In fact
the greater one is getting correct rounding and the lower one is not.
The correct roundings of both are the same.) But this case goes beyond
the rounding merely being incorrect; with this behaviour the rounding
isn't even self-consistent.

-zefram

@p6rt
Copy link
Author

p6rt commented Apr 13, 2018

From @zoffixznet

On Fri, 12 Aug 2016 10​:00​:17 -0700, zefram@​fysh.org wrote​:

"9.9989999999999991e0".EVAL < "9.998999999999999e0".EVAL
True

Observe that the literal with a greater nominal value yields a lower
Num value. (The .EVAL circumlocution is required to work around [perl
#​128820].) This implies that at least one of the literals is getting
incorrect rounding, which was the subject of [perl #​128912]. (In fact
the greater one is getting correct rounding and the lower one is not.
The correct roundings of both are the same.) But this case goes beyond
the rounding merely being incorrect; with this behaviour the rounding
isn't even self-consistent.

-zefram

Thank you for the report. This is now fixed.

Fix​: rakudo/rakudo@a760ac3cfc6426d9bd2fb00db
  MoarVM/MoarVM@b735866ddee9bd719440e5c82
Test​: Raku/roast@07830c2042b998128

@p6rt
Copy link
Author

p6rt commented Apr 13, 2018

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Apr 13, 2018

@zoffixznet - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Apr 13, 2018
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant