Skip to content

Commit aa30ada

Browse files
committedApr 7, 2015
attempt to fix 32-bit issue: try out making Base.rat use Int64s.
1 parent 3ffdaf5 commit aa30ada

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎base/range.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ FloatRange(a::FloatingPoint, s::FloatingPoint, l::Real, d::FloatingPoint) =
107107
# float rationalization helper
108108
function rat(x)
109109
y = x
110-
a = d = 1
111-
b = c = 0
110+
a = d = Int64(1)
111+
b = c = Int64(0)
112112
m = maxintfloat(Float32)
113113
while abs(y) <= m
114-
f = trunc(Int,y)
114+
f = trunc(Int64,y)
115115
y -= f
116116
a, c = f*a + c, a
117117
b, d = f*b + d, b
118-
max(abs(a),abs(b)) <= convert(Int,m) || return c, d
118+
max(abs(a),abs(b)) <= convert(Int64,m) || return c, d
119119
oftype(x,a)/oftype(x,b) == x && break
120120
y = inv(y)
121121
end

0 commit comments

Comments
 (0)