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
power-of two differences in minus operation #8859
Comments
From jan-perl@h-i-s.nlCreated by jan-perl@h-i-s.nlThe minus operator creates strange results for the given example. example program: #!/usr/bin/perl -w $mul=<STDIN>; example input: 4294967296 example output (WRONG, from given perl version) 4294967296 Correct output (as from the old perl on the old computer) 4294967296 Perl Info
|
From @doughera88On Sat, 31 Mar 2007, jhh wrote:
Here's a much shorter example that illustrates the same problem. You are correct that the exact details of rounding off in the last
That's odd. You'll have to show us specifically what you're doing. #!/usr/bin/perl -w __END__ # Actual output (Solaris/SPARC, 32-bit integers): $ perl5.6.2 bugreport $ perl5.8.8 bugreport Note too that for both 5.6 and 5.8, the value of $c rendered by -- |
The RT System itself - Status changed from 'new' to 'open' |
From @doughera88On Mon, 9 Apr 2007, Tels wrote:
Yes. I agree. That's why I said the original poster would have to You are also correct that the wrong number is still printed by -- |
From nospam-abuse@bloodgate.com-----BEGIN PGP SIGNED MESSAGE----- Moin, On Monday 09 April 2007 19:00:56 Andy Dougherty wrote:
When using "-Mbignum", the diff will be zero, but the printout of $c will be #!/usr/bin/perl -w Result (5.8.8 on 64bit, thus diff is 0 even without bignum): # perl acc.pl I am not sure if printf("%0.f", $bignumber) should actually truncate the All the best, Tels - -- "The need for a Steam account to play HL2 is like having to login to MS -- Tels iQEVAwUBRhqtJHcLPEOTuEwVAQIJhQf7BPTehno/agg+Qzw1tQkdL/dXFKLuwXby |
From jan-perl@h-i-s.nlWhat I really am trying to do is to verify the numbers are right: I did now check with bignum on, and actually get larger diffs I am not familiar enough with perl to change operator overloading etc. 4294967296 |
From jan-perl@h-i-s.nlI have posted a follow-up via the bug-tracking tool. -- |
From @dcollinsnIs there any more to this ticket than "floats have limited precision"? There's some discussion about printf('%f') under Bignum, but my understanding is that the %f format specifier is supposed to treat the input as a float. -- |
From @sisyphus-----Original Message-----
I think this crosses over into #41202 territory. I find that perl is assigning 449735057880383538 incorrectly - to internal For the script: my $mul = 2**32; my $a = 104712103; my $b = 50; I get outputs of (perl-5.16.0): Expected: 104712103 50 449735057880383538 0 and (perl-5.24.0): Expected: 104712103 50 449735057880383538 0 In both of those perls "my $c = 449735057880383538;" has assigned Cheers, |
Migrated from rt.perl.org#42260 (status was 'open')
Searchable as RT42260$
The text was updated successfully, but these errors were encountered: