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
Strange and unwarranted underflow in string-to-number #13389
Comments
From mwelinder@gmail.comCreated by mwelinder@gmail.comCompare the following two commands. The first one thinks the # echo 0.1530e-305 | perl -e '$v = <STDIN>; print "v=", $v + 0, "\n";' The above is not supposed to underflow; there are still a couple of orders Observed with 5.16.0 Observed with OpenSuSE build (5.16.0). Perl Info
|
From @iabynOn Thu, Oct 31, 2013 at 07:59:37AM -0700, via RT wrote:
I've (hopefully) fixed it with the following commit, which I've just commit 07079ca [perl #120426] atof() errors with trailing 0's -- |
The RT System itself - Status changed from 'new' to 'open' |
From zefram@fysh.orgDave Mitchell wrote:
Eww. That won't fix cases where the extra digits are non-zero, such as $ echo 0.15301e-305 | perl -e '$v = <STDIN>; print "v=", $v + 0, "\n";' -zefram |
From @iabynOn Mon, Dec 02, 2013 at 03:42:59PM +0000, Zefram wrote:
Oh yeah :-( I'll need to rethink that. -- |
From @iabynOn Mon, Dec 02, 2013 at 04:34:34PM +0000, Dave Mitchell wrote:
Second attempt now smoking as smoke-me/davem/float1: commit 72cfc30 [perl #120426] atof() small value rounding errors -- |
From mwelinder@gmail.comIf I understand you right, you are rolling your own atof. That is tricky http://www.exploringbinary.com/incorrectly-rounded-conversions-in-gcc-and-glibc/ that glibc has only recently gotten right. M. On Tue, Dec 3, 2013 at 8:32 AM, Dave Mitchell via RT
|
From @iabynOn Tue, Dec 03, 2013 at 01:21:53PM -0500, Morten Welinder wrote:
Yep.
Yep.
Thanks. Does anyone know why we roll our own? -- |
From @khwilliamsonOn 12/04/2013 10:22 AM, Dave Mitchell wrote:
There is a comment in sv.c /* This is evil, but floating point is even more evil */ It may be because we found plenty of bugs in vendor libc's and thought |
From perl5-porters@perl.orgDave Mitchell asked:
See the thread starting at <20010623225547.Z98663@plum.flirble.org>. Unfortunately, the reimplementation is the cause of several RT tickets |
From @sisyphus-----Original Message----- < (Whenever I care, I use POSIX::strtod.) Similarly, could we also have a POSIX::strtold available to Cheers, |
From mwelinder@gmail.comA simple solution to the overflow issues is to use the identity 10^n = 5^n * 2^n 5^n is much smaller and 2^n is harmless in the sense that multiplying Morten On Tue, Dec 3, 2013 at 8:32 AM, Dave Mitchell via RT
|
From @iabynOn Tue, Dec 03, 2013 at 01:31:27PM +0000, Dave Mitchell wrote:
Now in blead as b27804d. This doesn't address comments that appeared further in this thread. -- |
From @khwilliamsonOn Wed, 25 Dec 2013 13:51:27 -0800, davem wrote:
I looked through this ticket, and don't see any comments that haven't been addressed. Please highlight those that haven't been addressed. If none, we can close this ticket -- |
No response after 6 years. Closing ticket |
Migrated from rt.perl.org#120426 (status was 'open')
Searchable as RT120426$
The text was updated successfully, but these errors were encountered: