Skip Menu |
Report information
Id: 130155
Status: new
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)



Date: Wed, 23 Nov 2016 07:40:07 +0000
To: rakudobug [...] perl.org
From: Zefram <zefram [...] fysh.org>
Subject: [BUG] Rat operations give bogus underflow
Download (untitled) / with headers
text/plain 446b
Show quoted text
> 2e0**-1019
1.78005908680576e-307 Show quoted text
> 2e0**-1020
8.90029543402881e-308 Show quoted text
> 2.0**-1019
1.78005908680576e-307 Show quoted text
> 2.0**-1020
0 Show quoted text
> 0.5**1019
1.78005908680576e-307 Show quoted text
> 0.5**1020
0 Show quoted text
> 1 / (2.0**1019)
1.78005908680576e-307 Show quoted text
> 1 / (2.0**1020)
0 The three ways of computing 2**-1020 from Rat values all bogusly underflow to zero. As you can see, the exact value is representable in the Num type, which all of these Rat operations use for their results. -zefram
MoarVM PR fixing this sent: https://github.com/MoarVM/MoarVM/pull/442


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