We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent befa008 commit 27aba8cCopy full SHA for 27aba8c
2 files changed
src/math/prearith/prearith.jl
@@ -1,5 +1,5 @@
1
@inline signbit(a::DoubleFloat{T}) where {T} = signbit(HI(a))
2
-@inline sign(a::DoubleFloat{T}) where {T} = sign(HI(a))
+@inline sign(a::DoubleFloat{T}) where {T} = DoubleFloat{T}(sign(HI(a)))
3
4
@inline function (-)(a::DoubleFloat{T}) where {T<:IEEEFloat}
5
if iszero(LO(a)) || isnan(LO(a))
test/prearith.jl
@@ -26,6 +26,8 @@
26
# @test ldexp(significand(val), exponent(val)) == val
27
28
@test signs(val) == (sign(HI(val)), sign(LO(val)))
29
+ @test sign(val) === T(1)
30
+ @test sign(negval) === T(-1)
31
end
32
33
@testset "trunc $T" for T in (Double16, Double32, Double64)
0 commit comments