1- import scyjava
2- from scyjava import to_java , numeric_bounds
1+ from scyjava import numeric_bounds , to_java
32
43
54class TestTypes (object ):
@@ -8,20 +7,26 @@ class TestTypes(object):
87 """
98
109 def test_numeric_bounds (self ):
11- v_byte = to_java (1 , type = ' byte' )
12- v_short = to_java (2 , type = ' short' )
13- v_int = to_java (3 , type = ' int' )
14- v_long = to_java (4 , type = ' long' )
15- v_bigint = to_java (5 , type = ' bigint' )
16- v_float = to_java (6.7 , type = ' float' )
17- v_double = to_java (7.8 , type = ' double' )
18- v_bigdec = to_java (8.9 , type = ' bigdec' )
10+ v_byte = to_java (1 , type = " byte" )
11+ v_short = to_java (2 , type = " short" )
12+ v_int = to_java (3 , type = " int" )
13+ v_long = to_java (4 , type = " long" )
14+ v_bigint = to_java (5 , type = " bigint" )
15+ v_float = to_java (6.7 , type = " float" )
16+ v_double = to_java (7.8 , type = " double" )
17+ v_bigdec = to_java (8.9 , type = " bigdec" )
1918
2019 assert (- 128 , 127 ) == numeric_bounds (type (v_byte ))
2120 assert (- 32768 , 32767 ) == numeric_bounds (type (v_short ))
2221 assert (- 2147483648 , 2147483647 ) == numeric_bounds (type (v_int ))
23- assert (- 9223372036854775808 , 9223372036854775807 ) == numeric_bounds (type (v_long ))
22+ assert (- 9223372036854775808 , 9223372036854775807 ) == numeric_bounds (
23+ type (v_long )
24+ )
2425 assert (None , None ) == numeric_bounds (type (v_bigint ))
25- assert (- 3.4028234663852886e+38 , 3.4028234663852886e+38 ) == numeric_bounds (type (v_float ))
26- assert (- 1.7976931348623157e+308 , 1.7976931348623157e+308 ) == numeric_bounds (type (v_double ))
26+ assert (- 3.4028234663852886e38 , 3.4028234663852886e38 ) == numeric_bounds (
27+ type (v_float )
28+ )
29+ assert (- 1.7976931348623157e308 , 1.7976931348623157e308 ) == numeric_bounds (
30+ type (v_double )
31+ )
2732 assert (None , None ) == numeric_bounds (type (v_bigdec ))
0 commit comments