Commit | Line | Data |
b4bc5691 |
1 | |
2 | use strict; |
3 | |
4 | my ($x); |
5 | |
6 | ############################################################################### |
7 | # inf tests |
8 | |
9 | $x = 1+inf; ok (ref($x) =~ /^Math::BigInt/); ok ($x->bstr(),'inf'); |
10 | $x = 1*inf; ok (ref($x) =~ /^Math::BigInt/); ok ($x->bstr(),'inf'); |
11 | |
12 | # these don't work without exporting inf() |
13 | $x = inf; ok (ref($x) =~ /^Math::BigInt/); ok ($x->bstr(),'inf'); |
14 | $x = inf+inf; ok (ref($x) =~ /^Math::BigInt/); ok ($x->bstr(),'inf'); |
15 | $x = inf*inf; ok (ref($x) =~ /^Math::BigInt/); ok ($x->bstr(),'inf'); |
16 | |
17 | ############################################################################### |
18 | # NaN tests |
19 | |
20 | $x = 1+NaN; ok (ref($x) =~ /^Math::BigInt/); ok ($x->bstr(),'NaN'); |
21 | $x = 1*NaN; ok (ref($x) =~ /^Math::BigInt/); ok ($x->bstr(),'NaN'); |
22 | |
23 | # these don't work without exporting NaN() |
24 | $x = NaN; ok (ref($x) =~ /^Math::BigInt/); ok ($x->bstr(),'NaN'); |
25 | $x = NaN+NaN; ok (ref($x) =~ /^Math::BigInt/); ok ($x->bstr(),'NaN'); |
26 | $x = NaN*NaN; ok (ref($x) =~ /^Math::BigInt/); ok ($x->bstr(),'NaN'); |
27 | |
28 | ############################################################################### |
29 | # mixed tests |
30 | |
31 | # these don't work without exporting NaN() or inf() |
32 | $x = NaN+inf; ok (ref($x) =~ /^Math::BigInt/); ok ($x->bstr(),'NaN'); |
33 | $x = NaN*inf; ok (ref($x) =~ /^Math::BigInt/); ok ($x->bstr(),'NaN'); |
34 | $x = inf*NaN; ok (ref($x) =~ /^Math::BigInt/); ok ($x->bstr(),'NaN'); |
35 | |