Skip to content

Commit e476d04

Browse files
vtjnashnalimilan
authored andcommitted
reduce test time for rounding and floatfuncs (#51305)
These test were taking on the order of 5 minutes and 10-100s of GB, but they really did not need to. (cherry picked from commit bab20f4)
1 parent 697a178 commit e476d04

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

test/floatfuncs.jl

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,10 @@ end
139139
end
140140

141141
@testset "literal pow matches runtime pow matches optimized pow" begin
142-
two = 2
143-
@test 1.0000000105367122^2 == 1.0000000105367122^two
144-
@test 1.0041504f0^2 == 1.0041504f0^two
142+
let two = 2
143+
@test 1.0000000105367122^2 == 1.0000000105367122^two
144+
@test 1.0041504f0^2 == 1.0041504f0^two
145+
end
145146

146147
function g2(start, two, N)
147148
x = start
@@ -192,11 +193,13 @@ end
192193
finv(x) = f(x, -1)
193194
f2(x) = f(x, 2)
194195
f3(x) = f(x, 3)
195-
x = 1.0000000105367122
196-
@test x^2 == f(x, 2) == f2(x) == x*x == Float64(big(x)*big(x))
197-
@test x^3 == f(x, 3) == f3(x) == x*x*x == Float64(big(x)*big(x)*big(x))
198-
x = 1.000000007393669
199-
@test x^-1 == f(x, -1) == finv(x) == 1/x == inv(x) == Float64(1/big(x)) == Float64(inv(big(x)))
196+
let x = 1.0000000105367122
197+
@test x^2 == f(x, 2) == f2(x) == x*x == Float64(big(x)*big(x))
198+
@test x^3 == f(x, 3) == f3(x) == x*x*x == Float64(big(x)*big(x)*big(x))
199+
end
200+
let x = 1.000000007393669
201+
@test x^-1 == f(x, -1) == finv(x) == 1/x == inv(x) == Float64(1/big(x)) == Float64(inv(big(x)))
202+
end
200203
end
201204

202205
@testset "curried approximation" begin

0 commit comments

Comments
 (0)