diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-01-25 19:42:30 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-01-25 19:42:30 +0000 |
commit | 2803fa059ea0dd9276f1b5bace7748e8b86790a5 (patch) | |
tree | 1b87042000df96f988e228b8d6960d76be39673e /t | |
parent | 5a17876fec93d2d9eeb8689d271a67aeaf8a99e2 (diff) | |
parent | c52f9dcd042177cd20ef53fca007b7305fd4972f (diff) | |
download | perl-2803fa059ea0dd9276f1b5bace7748e8b86790a5.tar.gz |
Integrate mainline
p4raw-id: //depot/perlio@8550
Diffstat (limited to 't')
-rwxr-xr-x | t/lib/bigfltpm.t | 66 | ||||
-rwxr-xr-x | t/lib/bigintpm.t | 10 |
2 files changed, 74 insertions, 2 deletions
diff --git a/t/lib/bigfltpm.t b/t/lib/bigfltpm.t index b335d13016..a9725bad69 100755 --- a/t/lib/bigfltpm.t +++ b/t/lib/bigfltpm.t @@ -9,7 +9,7 @@ use Math::BigFloat; $test = 0; $| = 1; -print "1..362\n"; +print "1..406\n"; while (<DATA>) { chop; if (s/^&//) { @@ -33,6 +33,8 @@ while (<DATA>) { $try .= "-\$x;"; } elsif ($f eq "fabs") { $try .= "abs \$x;"; + } elsif ($f eq "fint") { + $try .= "int \$x;"; } elsif ($f eq "fround") { $try .= "0+\$x->fround($args[1]);"; } elsif ($f eq "ffround") { @@ -73,6 +75,25 @@ while (<DATA>) { } } } + +{ + use Math::BigFloat ':constant'; + + $test++; + # print "# " . 2. * '1427247692705959881058285969449495136382746624' . "\n"; + print "not " + unless 2. * '1427247692705959881058285969449495136382746624' + == "2854495385411919762116571938898990272765493248."; + print "ok $test\n"; + $test++; + @a = (); + for ($i = 1.; $i < 10; $i++) { + push @a, $i; + } + print "not " unless "@a" eq "1. 2. 3. 4. 5. 6. 7. 8. 9."; + print "ok $test\n"; +} + __END__ &fnorm abc:NaN. @@ -461,3 +482,46 @@ $Math::BigFloat::div_scale = 40 +100:10. +123.456:11.11107555549866648462149404118219234119 +15241.383936:123.456 +&fint ++0:+0 ++1:+1 ++11111111111111111234:+11111111111111111234 +-1:-1 +-11111111111111111234:-11111111111111111234 ++0.3:+0 ++1.3:+1 ++23.3:+23 ++12345678901234567890:+12345678901234567890 ++12345678901234567.890:+12345678901234567 ++12345678901234567890E13:+123456789012345678900000000000000 ++12345678901234567.890E13:+123456789012345678900000000000 ++12345678901234567890E-3:+12345678901234567 ++12345678901234567.890E-3:+12345678901234 ++12345678901234567890E-13:+1234567 ++12345678901234567.890E-13:+1234 ++12345678901234567890E-17:+123 ++12345678901234567.890E-16:+1 ++12345678901234567.890E-17:+0 ++12345678901234567890E-19:+1 ++12345678901234567890E-20:+0 ++12345678901234567890E-21:+0 ++12345678901234567890E-225:+0 +-0:+0 +-0.3:+0 +-1.3:-1 +-23.3:-23 +-12345678901234567890:-12345678901234567890 +-12345678901234567.890:-12345678901234567 +-12345678901234567890E13:-123456789012345678900000000000000 +-12345678901234567.890E13:-123456789012345678900000000000 +-12345678901234567890E-3:-12345678901234567 +-12345678901234567.890E-3:-12345678901234 +-12345678901234567890E-13:-1234567 +-12345678901234567.890E-13:-1234 +-12345678901234567890E-17:-123 +-12345678901234567.890E-16:-1 +-12345678901234567.890E-17:+0 +-12345678901234567890E-19:-1 +-12345678901234567890E-20:+0 +-12345678901234567890E-21:+0 +-12345678901234567890E-225:+0 diff --git a/t/lib/bigintpm.t b/t/lib/bigintpm.t index e76f246f18..dac6f5f4a0 100755 --- a/t/lib/bigintpm.t +++ b/t/lib/bigintpm.t @@ -9,7 +9,7 @@ use Math::BigInt; $test = 0; $| = 1; -print "1..278\n"; +print "1..283\n"; while (<DATA>) { chop; if (s/^&//) { @@ -25,6 +25,8 @@ while (<DATA>) { $try .= "-\$x;"; } elsif ($f eq "babs") { $try .= "abs \$x;"; + } elsif ($f eq "bint") { + $try .= "int \$x;"; } else { $try .= "\$y = new Math::BigInt \"$args[1]\";"; if ($f eq "bcmp"){ @@ -375,3 +377,9 @@ abc:NaN +0:-1 +8:-9 +281474976710656:-281474976710657 +&bint ++0:+0 ++1:+1 ++11111111111111111234:+11111111111111111234 +-1:-1 +-11111111111111111234:-11111111111111111234 |