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
Inconsistent math with large numbers #9553
Comments
From @andkCreated by @andkCPAN testers have found 12 versions of perl that believe that X89.2 is larger than X90, with X being 1234567891234567. This is not limited to use64bitint architectures and 64 bit boxes are not behaving better. Appending a .0 to the integer solves the bug on all architectures but this is considered unperlish at best. Here are a few data points about the twelve perls. By prepending http://www.nntp.perl.org/group/perl.cpan.testers/ to the first column you get the full report to see further details. 2537148 meta:perl[5.10.0] conf:archname[x86_64-linux] conf:ivtype[long] Perl Info
|
From @jkeenanOn Mon Nov 03 00:04:35 2008, andreas.koenig.7os6VVqR@franz.ak.mind.de wrote:
Composing a link pursuant to these instructions took me to: http://www.cpantesters.org/static/recent.html How should I proceed from there? Would it be possible to provide some examples directly in RT? Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From @tonycozOn Sat, Feb 16, 2013 at 05:40:50PM -0800, James E Keenan via RT wrote:
They can be found with a http://www.cpantesters.org/cpan/report/ prefix, so the first is: http://www.cpantesters.org/cpan/report/2537148 Newer reports can be found at: http://www.cpantesters.org/distro/A/Acme-Study-Perl.html (The inconsistencies don't cause test failures) Tony |
From @bulk88On Mon Nov 03 00:04:35 2008, andreas.koenig.7os6VVqR@franz.ak.mind.de wrote:
cygperl 5.14.2 32 bit with 64 IVs C:\> C:\> ___________________________________________ C:\> my conclusion, only happens if 64 bit IVs, regardless of ptr size -- |
From @bulk88On Sat Feb 16 19:00:16 2013, bulk88 wrote:
On a x64 perl, asm CVTSI2SD ("Convert one signed quadword integer from + xiv_u {xivu_iv=123456789123456790 xivu_uv=123456789123456790 from 64b int to NV. The result of CVTSI2SD was XMM0DL = +1.23456789123457E+017 lnv took the macro shortcut since it already was an NV, and didn't call lnv as I64 is 0x437b69b4bacd05f2 SV * left's nv member is + xnv_u {xnv_nv=1.2345678912345680e+017 xgv_stash=0x437b69b4bacd05f2 sample script was its FP round off, this is confirmed with "log(123 456 789 123 456 790) / I am not sure what can be done here. If one side of the script cmp IV is -- |
From @arcbulk88 via RT <perlbug-followup@perl.org> wrote:
I don't think that would help in every case of this sort. my $iv = 123456789123456784; Mathematically, that ought to be true, but neither converting $iv to I think the answer is that you have to use something like bignum or -- |
From @andk"Aaron Crane via RT" <perlbug-followup@perl.org> writes:
I'm sorry, I can't follow you. The example in the original ticket is -- |
From @arcAndreas Koenig <andreas.koenig.7os6VVqR@franz.ak.mind.de> wrote:
Andreas, I apologise; I picked up the ">" example from bulk88's AIUI, the first example in t/studyperl.t for A::S::P 0.0.2 ultimately does this: eval q/ "123456789123456789.2" <=> "123456789123456790" /; As you point out, actually running that (on at least some Perls) While this is mathematically unexpected, I don't think it represents a On the other hand, converting such numbers to integers will work (if This program demonstrates what I mean: for my $i (123456789123456776 .. 123456789123456792) { When run on a Perl with 64-bit IV, the ".." loop will use precise 123456789123456776 123456789123456768.0 f005cdbab4697b43 Note that everything in X+77 .. X+91 inclusive has the same That's why I say this can't be meaningfully fixed without using some -- |
From @andk"Aaron Crane via RT" <perlbug-followup@perl.org> writes:
Accepted;)
There are not precise answers and there are outspoken miserable answers.
Converting to intergers would also be wrong. If the user expects a
This is a very nice demonstration of what's going on, thank you.
We have three answers: X+89.2 > X+90 # (A) some perls believe this is true X+89.2 == X+90.0 # (B) all perls agree on this one (iirc) X+89.2 < X+90 # (C) bigfoats can deal with this I know where I can get (C): with big modules. This is not the task to But I find it unacceptable that (A) can happen while (B) also can -- |
Migrated from rt.perl.org#60318 (status was 'open')
Searchable as RT60318$
The text was updated successfully, but these errors were encountered: