in reply to Re^2: Decimal Floating Point (DFP) and does Perl needs DFP?
in thread Decimal Floating Point (DFP) and does Perl needs DFP?
Or, to 6 decimal places: 1141973130130727445029596475.971760 which is the same as flexvault got.C:\>perl -MMath::Decimal128=":all" -le "$n1=Math::Decimal128->new('10' +, 0);$n2=Math::Decimal128->new('1000001', -6);for(1..60000000){$n1 *= + $n2}print $n1;" 114197313013072744502959647597176e-5
Or, printing to 28 decimal digits (which implies a level of precision that we don't have):C:\>perl -MMath::LongDouble=":all" -le "$n1=Math::LongDouble->new('10' +);$n2=Math::LongDouble->new('1.000001');for(1..60000000){$n1 *= $n2}p +rint $n1;" 1.14197313013239314e+027
This figure is equivalent to the first one you quoted.C:\>perl -MMath::LongDouble=":all" -le "$n1=Math::LongDouble->new('10' +);$n2=Math::LongDouble->new('1.000001');for(1..60000000){$n1 *= $n2}p +rint LDtoSTRP($n1, 28);" 1.141973130132393144424071168e+027
This differs from your second figure - and I don't think there's any valid reason that they should differ.C:\>perl -MMath::Float128=":all" -le "$n1=Math::Float128->new('10');$n +2=Math::Float128->new('1.000001');for(1..60000000){$n1 *= $n2}print $ +n1;" 1.14197313013072744502959647306684e+27
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Decimal Floating Point (DFP) and does Perl needs DFP?
by LanX (Saint) on Jan 19, 2015 at 01:44 UTC | |
by syphilis (Archbishop) on Jan 19, 2015 at 03:48 UTC | |
by LanX (Saint) on Jan 19, 2015 at 09:41 UTC | |
by syphilis (Archbishop) on Jan 20, 2015 at 14:40 UTC | |
by LanX (Saint) on Jan 20, 2015 at 15:10 UTC | |
| |
|
Re^4: Decimal Floating Point (DFP) and does Perl needs DFP?
by Anonymous Monk on Jan 19, 2015 at 18:55 UTC | |
by syphilis (Archbishop) on Jan 19, 2015 at 23:34 UTC |