in reply to bug in Perl compilation?
Looks like your standard floating point inaccuracies to me. Try
$num1 = 12e-4; $num2 = 1.2e-3; printf("%.18g\n", $num1); printf("%.18g\n", $num2);
(Sorry, I can't call a scalar that's meant to hold a numeric value "string" anything)
Remember that something somewhere has to do the computation to turn that scientific notation into a real number and that any computation involving floating point numbers is sure to have precision problems.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: bug in Perl compilation?
by bkgallo (Initiate) on Dec 21, 2005 at 19:18 UTC | |
by revdiablo (Prior) on Dec 21, 2005 at 23:25 UTC |