Debian Codegraph @

src/test/01-Basic/86.ck

raw
1 // big number
2 1000000000000000000000000000.0 => float n;
3 // overflow it
4 repeat( 20 ) n *=> n;
5 // test it
6 <<< Math.isinf( n ) >>>;
7 // bye sanity
8 0 *=> n;
9 // test it
10 <<< Math.isnan( n ) >>>;
11
12 // *** RE-ENABLED in 1.4.2.1; differences due the fast-math compiler flag
13 // for example, if -ffast-math enabled, the above returns 1 on Mac
14 // intel but 0 on Mac arm64; fast-math is now disabled by default ***
15
16 // more
17 <<< 1.0 / 0.0 => Math.isinf >>>;
18 // *** the following alos differs if fast-math is enabled
19 <<< 0.0 / 0.0 => Math.isnan >>>;
20 <<< Math.INFINITY, -Math.INFINITY >>>;
21 <<< Math.INFINITY => Math.isinf >>>;