17
17
// RUN: %line-directive %t/NumericParsing.swift -- %target-run %t/a.out
18
18
// REQUIRES: executable_test
19
19
% {
20
+ from __future__ import division
20
21
from SwiftIntTypes import all_integer_types
21
22
22
23
word_bits = int ( CMAKE_SIZEOF_VOID_P)
@@ -36,7 +37,7 @@ Note: the third parameter, zero, is not for user consumption.
36
37
else :
37
38
r = n % radix
38
39
digit = chr( ( ord ( '0 ') + r) if r < 10 else ( ord ( 'a') + r - 10 ) )
39
- return inRadix( radix, int ( n / radix) , '') + digit
40
+ return inRadix( radix, int ( n // radix), '') + digit
40
41
41
42
# The maximal legal radix
42
43
max_radix = ord ( 'z') - ord( 'a') + 1 + 10
@@ -96,7 +97,7 @@ tests.test("${Self}/success") {
96
97
% for radix in radices_to_test:
97
98
% for n in required_values + list( range(
98
99
% minValue + 1 , maxValue - 1 ,
99
- % int( ( maxValue - minValue - 2 ) / ( number_of_values - len( required_values) ) ) ) ) :
100
+ % int( ( maxValue - minValue - 2 ) // (number_of_values - len(required_values))))):
100
101
% prefix = '+ ' if n > 0 and n % 2 == 0 else '' # leading '+ '
101
102
% text = inRadix ( radix, n)
102
103
expectEqual( ${ n} , ${ Self} ( " ${prefix + text} " , radix: ${ radix} ) )
0 commit comments