in reply to Determining the minimum representable increment/decrement possible?
$fp2 = -8.2727285363069939e-293;; printf "% 25.17g\n", $fp2;; -7.9999999999999948e-293 ### WTF? ###
Yet, according to the very same perl, the 2 values are entirely different:C:\>perl -le "printf '%.16e', -8.2727285363069939e-293;" -7.9999999999999948e-293
UIM, this is not perl's fault. (But I am mistaken - see UPDATE and UPDATE2.) Perls built (from the same source) with gcc on the same machine do not suffer this problem.C:\>perl -le "print scalar reverse unpack 'h*', pack 'd<', -7.99999999 +99999948e-293;" 83465a792c83e3b6 C:\>perl -le "print scalar reverse unpack 'h*', pack 'd<', -8.27272853 +63069939e-293;" 83498bf832dfdfab
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Determining the minimum representable increment/decrement possible? (Perl's scanf broken?)
by BrowserUk (Patriarch) on Jun 17, 2016 at 13:41 UTC | |
by syphilis (Archbishop) on Jun 17, 2016 at 14:37 UTC | |
by BrowserUk (Patriarch) on Jun 17, 2016 at 14:47 UTC | |
by syphilis (Archbishop) on Jun 17, 2016 at 15:22 UTC | |
by BrowserUk (Patriarch) on Jun 17, 2016 at 16:04 UTC | |
| |
by ikegami (Patriarch) on Jun 19, 2016 at 04:45 UTC |