develooper Front page | perl.perl6.compiler | Postings from April 2018

[perl #128913] [BUG] decimal->float non-monotonic conversion

Thread Previous | Thread Next
From:
Zoffix Znet via RT
Date:
April 13, 2018 08:38
Subject:
[perl #128913] [BUG] decimal->float non-monotonic conversion
Message ID:
rt-4.0.24-14053-1523608700-1299.128913-15-0@perl.org
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:  https://github.com/rakudo/rakudo/commit/a760ac3cfc6426d9bd2fb00db
      https://github.com/MoarVM/MoarVM/commit/b735866ddee9bd719440e5c82
Test: https://github.com/perl6/roast/commit/07830c2042b998128

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About