diff options
author | Allen Smith <allens@cpan.org> | 2002-09-07 01:25:45 -0400 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-09-08 17:10:38 +0000 |
commit | 20f6aaab8d64a33be1150bb7a380a1b5d03267cb (patch) | |
tree | d31bbbbc33401f4b56b0e88fd778a96a0eaf4b5d /t | |
parent | d3d0e6f1233c0621cb4930e677ea82e761029cf7 (diff) | |
download | perl-20f6aaab8d64a33be1150bb7a380a1b5d03267cb.tar.gz |
Re: [PATCH: perl #17849] (corrected) Long double bugs - sprintf.t _and_ num.t
From: "Allen Smith" <easmith@beatrice.rutgers.edu>
Message-Id: <10209070525.ZM1584639@puck2.rutgers.edu>
p4raw-id: //depot/perl@17874
Diffstat (limited to 't')
-rw-r--r-- | t/base/num.t | 8 | ||||
-rwxr-xr-x | t/op/sprintf.t | 8 |
2 files changed, 13 insertions, 3 deletions
diff --git a/t/base/num.t b/t/base/num.t index 714881e977..6a93355d3a 100644 --- a/t/base/num.t +++ b/t/base/num.t @@ -1,6 +1,6 @@ #!./perl -print "1..49\n"; +print "1..50\n"; # First test whether the number stringification works okay. # (Testing with == would exercize the IV/NV part, not the PV.) @@ -179,3 +179,9 @@ print $a == 80000.0 ? "ok 48\n" : "not ok 48\n"; $a = 1.0000000000000000000000000000000000000000000000000000000000000000000e1; print $a == 10.0 ? "ok 49\n" : "not ok 49\n"; + +# From Math/Trig - number has to be long enough to exceed at least DBL_DIG + +$a = 57.295779513082320876798154814169; +print ok($a*10,572.95779513082320876798154814169,1e-10) ? "ok 50\n" : + "not ok 50 # $a\n"; diff --git a/t/op/sprintf.t b/t/op/sprintf.t index c67e65e9d4..b23978ca8b 100755 --- a/t/op/sprintf.t +++ b/t/op/sprintf.t @@ -236,6 +236,8 @@ __END__ >%#e< >-1234.875< >-1.234875e+03< >%.0e< >1234.875< >1e+03< >%#.0e< >1234.875< >1.e+03< +>%.0e< >1.875< >2e+00< +>%.0e< >0.875< >9e-01< >%.*e< >[0, 1234.875]< >1e+03< >%.1e< >1234.875< >1.2e+03< >%-12.4e< >1234.875< >1.2349e+03 < @@ -265,8 +267,10 @@ __END__ >%.0f< >0< >0< >%.0f< >2**38< >274877906944< >Should have exact int'l rep'n< >%.0f< >0.1< >0< ->%.0f< >0.6< >1< >Known to fail with sfio and (irix|nonstop-ux|powerux)< ->%.0f< >-0.6< >-1< >Known to fail with sfio and (irix|nonstop-ux|powerux)< +>%.0f< >0.6< >1< >Known to fail with sfio, (irix|nonstop-ux|powerux); -DHAS_LDBL_SPRINTF_BUG may fix< +>%.0f< >-0.6< >-1< >Known to fail with sfio, (irix|nonstop-ux|powerux); -DHAS_LDBL_SPRINTF_BUG may fix< +>%.0f< >1.6< >2< +>%.0f< >-1.6< >-2< >%.0f< >1< >1< >%#.0f< >1< >1.< >%g< >12345.6789< >12345.7< |