3535 print (int (1418774543.0 ))
3636 print ("%d" % 1418774543.0 )
3737 if ll_type == 3 :
38- print (int (2.0 ** 100 ))
39- print ("%d" % 2.0 ** 100 )
38+ print (int (2.0 ** 100 ))
39+ print ("%d" % 2.0 ** 100 )
4040else :
4141 print (int (1073741823.0 ))
4242 print ("%d" % 1073741823.0 )
4343
4444testpass = True
4545p2_rng = ((30 , 63 , 1024 ), (62 , 63 , 1024 ))[is_64bit ][ll_type ]
4646for i in range (0 , p2_rng ):
47- bitcnt = len (bin (int (2.0 ** i ))) - 3
47+ bitcnt = len (bin (int (2.0 ** i ))) - 3
4848 if i != bitcnt :
4949 print ("fail: 2**%u was %u bits long" % (i , bitcnt ))
5050 testpass = False
5353testpass = True
5454p10_rng = ((9 , 18 , 23 ), (18 , 18 , 23 ))[is_64bit ][ll_type ]
5555for i in range (0 , p10_rng ):
56- digcnt = len (str (int (10.0 ** i ))) - 1
56+ digcnt = len (str (int (10.0 ** i ))) - 1
5757 if i != digcnt :
5858 print ("fail: 10**%u was %u digits long" % (i , digcnt ))
5959 testpass = False
@@ -72,28 +72,28 @@ def fp2int_test(num, name, should_fail):
7272if ll_type != 2 :
7373 if ll_type == 0 :
7474 if is_64bit :
75- neg_bad_fp = - 1.00000005 * 2.0 ** 62.0
76- pos_bad_fp = 2.0 ** 62.0
77- neg_good_fp = - (2.0 ** 62.0 )
78- pos_good_fp = 0.99999993 * 2.0 ** 62.0
75+ neg_bad_fp = - 1.00000005 * 2.0 ** 62.0
76+ pos_bad_fp = 2.0 ** 62.0
77+ neg_good_fp = - (2.0 ** 62.0 )
78+ pos_good_fp = 0.99999993 * 2.0 ** 62.0
7979 else :
80- neg_bad_fp = - 1.00000005 * 2.0 ** 30.0
81- pos_bad_fp = 2.0 ** 30.0
82- neg_good_fp = - (2.0 ** 30.0 )
83- pos_good_fp = 0.9999999499 * 2.0 ** 30.0
80+ neg_bad_fp = - 1.00000005 * 2.0 ** 30.0
81+ pos_bad_fp = 2.0 ** 30.0
82+ neg_good_fp = - (2.0 ** 30.0 )
83+ pos_good_fp = 0.9999999499 * 2.0 ** 30.0
8484 else :
85- neg_bad_fp = - 0.51 * 2.0 ** 64.0
86- pos_bad_fp = 2.0 ** 63.0
87- neg_good_fp = - (2.0 ** 63.0 )
88- pos_good_fp = 1.9999998 * 2.0 ** 62.0
85+ neg_bad_fp = - 0.51 * 2.0 ** 64.0
86+ pos_bad_fp = 2.0 ** 63.0
87+ neg_good_fp = - (2.0 ** 63.0 )
88+ pos_good_fp = 1.9999998 * 2.0 ** 62.0
8989
9090 fp2int_test (neg_bad_fp , "neg bad" , True )
9191 fp2int_test (pos_bad_fp , "pos bad" , True )
9292 fp2int_test (neg_good_fp , "neg good" , False )
9393 fp2int_test (pos_good_fp , "pos good" , False )
9494else :
95- fp2int_test (- 1.9999999999999981 * 2.0 ** 1023.0 , "large neg" , False )
96- fp2int_test (1.9999999999999981 * 2.0 ** 1023.0 , "large pos" , False )
95+ fp2int_test (- 1.9999999999999981 * 2.0 ** 1023.0 , "large neg" , False )
96+ fp2int_test (1.9999999999999981 * 2.0 ** 1023.0 , "large pos" , False )
9797
9898fp2int_test (float ("inf" ), "inf test" , True )
9999fp2int_test (float ("-inf" ), "inf test" , True )
0 commit comments