Skip Menu |
Report information
Id: 128913
Status: resolved
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: zefram [at] fysh.org
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



From: Zefram <zefram [...] fysh.org>
To: rakudobug [...] perl.org
Subject: [BUG] decimal->float non-monotonic conversion
Date: Fri, 12 Aug 2016 18:00:01 +0100
Download (untitled) / with headers
text/plain 595b
Show quoted text
> "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
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 933b
On Fri, 12 Aug 2016 10:00:17 -0700, zefram@fysh.org wrote: Show quoted text
> > "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: https://github.com/rakudo/rakudo/commit/a760ac3cfc6426d9bd2fb00db https://github.com/MoarVM/MoarVM/commit/b735866ddee9bd719440e5c82 Test: https://github.com/perl6/roast/commit/07830c2042b998128


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org