We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 447cd05 commit 6cb6c58Copy full SHA for 6cb6c58
base/special/trig.jl
@@ -927,8 +927,8 @@ function sincospi(x::T) where T<:Rational
927
end
928
929
930
-sinpi(x::Integer) = x >= 0 ? zero(float(x)) : -zero(float(x))
931
-cospi(x::Integer) = isodd(x) ? -one(float(x)) : one(float(x))
+sinpi(x::T) where {T<:Integer} = zero(signed(T))
+cospi(x::T) where {T<:Integer} = isodd(x) ? -one(signed(T)) : one(signed(T))
932
sincospi(x::Integer) = (sinpi(x), cospi(x))
933
sinpi(x::Real) = sinpi(float(x))
934
cospi(x::Real) = cospi(float(x))
0 commit comments