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
== on Num literals produces bogus answer #5521
Comments
From zefram@fysh.org
Say what? These are distinct Num values, differing by 10 ulp.
== and === give the right result when applied to $a and $b as here, or -zefram |
From @pmichaudOn Tue, Aug 02, 2016 at 10:55:34AM -0700, Zefram wrote:
It's not universally true that Num literals like these "work fine in other contexts" -- the pair of literals in the example given "work" because they differ in the fifteenth decimal digit of precision. This is within the acceptable norms for Num (floating point) precision. Choosing a different pair of literal values that differ beyond the first 15 digits of precision shows that things do not work fine in other contexts:
In short, it's "normal" (expected behavior) for mathematical errors to occur beyond 15 digits of precision in Num (floating point) values. Pm |
The RT System itself - Status changed from 'new' to 'open' |
From zefram@fysh.orgPatrick R. Michaud via RT wrote:
Once again, you're mistakenly supposing my complaint to be from a
It is not normal for the same literal to represent two different values More information: upon further experimentation, it seems that the critical
Perhaps the compiler is coalescing the constants based on them having -zefram |
From zefram@fysh.orgAdditional: this also happens with Complex literals, where the real or -zefram |
From @zoffixznetOn Tue, 02 Aug 2016 10:55:34 -0700, zefram@fysh.org wrote:
Thank you for the report. This is now fixed. Fix: MoarVM/MoarVM@067c0594103a025 |
@zoffixznet - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#128820 (status was 'resolved')
Searchable as RT128820$
The text was updated successfully, but these errors were encountered: