-
Notifications
You must be signed in to change notification settings - Fork 567
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
floating-point binary-decimal conversion bugs #9125
Comments
From vincent-perl@vinc17.netCreated by vincent@vinc17.orgThe following Perl script gives strange results on most machines #!/usr/bin/env perl use strict; my $uld = $Config{uselongdouble} ? ', uselongdouble' : ''; my $x = 7.0868766365730135e-268; __END__ Below, only vin, zaurus and allo-psmn are correct. I first thought * vin.lip.ens-lyon.fr * courge.ens-lyon.fr * itanium.ens-lyon.fr * zaurus * ay * prunille * allo-psmn.ens-lyon.fr * bar.loria.fr * td152.testdrive.hp.com * td191.testdrive.hp.com Perl Info
|
From @cpansproutI think this is a duplicate of #41202, but I’m not sure. |
@cpansprout - Status changed from 'new' to 'open' |
From zefram@fysh.orgFather Chrysostomos wrote:
It's in two parts, one of which is [perl #41202], the other of which On the input side, the decimal literal is being converted incorrectly On output there's a separate problem. The scaled version of the On my machine (amd64, Linux 3.16.0, glibc 2.19) I can reproduce Putting aside the input problem, since it's got its own ticket, the $ perl -lwe 'printf "%.1f\n%.0f\n", (0x1.766554433220dp+52) x 2' This problem is not specific to the value resulting from the erroneous -zefram |
From zefram@fysh.orgThe output problem is a bug in the internal F0convert(), which is used to There's another bug in F0convert(), which is that it can't distinguish $ perl -lwe 'printf "%-.0f %.0f\n", ($_) x 2 for 0.0, -0.0' I've fixed both of these bugs in commit -zefram |
Closed (finally) as Zefram suggested. |
Migrated from rt.perl.org#47602 (status was 'open')
Searchable as RT47602$
The text was updated successfully, but these errors were encountered: