1 USING: kernel math math.parser sequences tools.test ;
9 [ "12345abcdef" string>number ]
13 [ "-12" string>number 0 < ]
17 [ "--12" string>number ]
29 [ "1.0e2" string>number number>string ]
33 [ "-1.0e2" string>number number>string ]
37 [ "1.0e-2" string>number number>string ]
41 [ "-1.0e-2" string>number number>string ]
45 [ "-1.0e-12" string>number number>string { "-1.0e-12" "-1.0e-012" } member? ]
49 [ "-1e-2e4" string>number ]
53 [ "3.14" string>number number>string ]
61 [ ".e" string>number ]
65 [ "1.01e2" string>number number>string ]
69 [ "-1.01e2" string>number number>string ]
73 [ "101.0e-2" string>number number>string ]
77 [ "-101.0e-2" string>number number>string ]
81 [ "1e1/2" string>number ]
85 [ "e/2" string>number ]
88 [ f ] [ "12" bin> ] unit-test
89 [ f ] [ "fdsf" bin> ] unit-test
90 [ 3 ] [ "11" bin> ] unit-test
92 [ f ] [ "\0." string>number ] unit-test
94 [ 1 1 >base ] must-fail
95 [ 1 0 >base ] must-fail
96 [ 1 -1 >base ] must-fail
98 [ "0.0/0.0" ] [ 0.0 0.0 / number>string ] unit-test
100 [ "1.0/0.0" ] [ 1.0 0.0 / number>string ] unit-test
102 [ "-1.0/0.0" ] [ -1.0 0.0 / number>string ] unit-test
104 [ t ] [ "0/0." string>number fp-nan? ] unit-test
106 [ 1.0/0.0 ] [ "1/0." string>number ] unit-test
108 [ -1.0/0.0 ] [ "-1/0." string>number ] unit-test
110 [ "-0.0" ] [ -0.0 number>string ] unit-test
112 [ "-3/4" ] [ -3/4 number>string ] unit-test
113 [ "-1-1/4" ] [ -5/4 number>string ] unit-test