- or download this
C:\>perl -le "print 'ok' if 3335.9999999999995 > 3335.999999999999;"
ok
- or download this
C:\>perl -le "print 3335.9999999999995; print 3335.999999999999;"
3336
3336
- or download this
C:>perl -le "print 'ok' if 3335.9999999999995 + 0.0000000000001 == 333
+5.9999999999995;"
ok
- or download this
C:\>perl -le "print 3335.9999999999995;"
3336
- or download this
printf "%a", $float;
or
printf "%.16e", $float;
- or download this
C:\>perl -MMath::MPFR=":mpfr" -le "print nvtoa(2 ** -1074);"
5e-324
C:\>perl -MMath::MPFR=":mpfr" -le "print nvtoa(sqrt 2.0);"
1.4142135623730951
- or download this
use POSIX qw(strtod);
$x = strtod('1234e-5');
- or download this
$x = 1234e-5;
- or download this
use Math::MPFR qw(:mpfr);
$x = atonv('1234e-5');