We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0b6cab6 + afa0e53 commit c6c6842Copy full SHA for c6c6842
base/floatfuncs.jl
@@ -176,7 +176,7 @@ const ≈ = isapprox
176
# default tolerance arguments
177
rtoldefault{T<:AbstractFloat}(::Type{T}) = sqrt(eps(T))
178
rtoldefault{T<:Real}(::Type{T}) = 0
179
-rtoldefault{T<:Number,S<:Number}(x::Union{T,Type{T}}, y::Union{S,Type{S}}) = rtoldefault(promote_type(real(T),real(S)))
+rtoldefault{T<:Number,S<:Number}(x::Union{T,Type{T}}, y::Union{S,Type{S}}) = max(rtoldefault(real(T)),rtoldefault(real(S)))
180
181
# fused multiply-add
182
fma_libm(x::Float32, y::Float32, z::Float32) =
test/math.jl
@@ -387,19 +387,19 @@ j33 = besselj(3,3.)
387
@test besselj(-3,-3) == j33
388
@test besselj(-3,3) == -j33
389
@test besselj(3,-3) == -j33
390
-@test besselj(3,3f0) ≈ Float32(j33)
+@test besselj(3,3f0) ≈ j33
391
@test besselj(3,complex(3.)) ≈ j33
392
-@test besselj(3,complex(3f0)) ≈ Float32(j33)
+@test besselj(3,complex(3f0)) ≈ j33
393
@test besselj(3,complex(3)) ≈ j33
394
395
j43 = besselj(4,3.)
396
@test besselj(4,3) == j43
397
@test besselj(-4,-3) == j43
398
@test besselj(-4,3) == j43
399
@test besselj(4,-3) == j43
400
-@test besselj(4,3f0) ≈ Float32(j43)
+@test besselj(4,3f0) ≈ j43
401
@test besselj(4,complex(3.)) ≈ j43
402
-@test besselj(4,complex(3f0)) ≈ Float32(j43)
+@test besselj(4,complex(3f0)) ≈ j43
403
@test besselj(4,complex(3)) ≈ j43
404
405
@test_approx_eq j33 0.30906272225525164362
test/numbers.jl
@@ -1663,10 +1663,10 @@ end
1663
@test isnan(eps(-Inf))
1664
1665
@test .1+.1+.1 != .3
1666
-# TODO: uncomment when isapprox() becomes part of base.
1667
-# @test isapprox(.1+.1+.1, .3)
1668
-# @test !isapprox(.1+.1+.1-.3, 0)
1669
-# @test isapprox(.1+.1+.1-.3, 0, eps(.3))
+@test isapprox(.1+.1+.1, .3)
+@test !isapprox(.1+.1+.1-.3, 0)
+@test isapprox(.1+.1+.1-.3, 0, atol=eps(.3))
+@test isapprox(1.1,1.1f0)
1670
1671
@test div(1e50,1) == 1e50
1672
@test fld(1e50,1) == 1e50
0 commit comments