Skip to content

Commit 6cb6c58

Browse files
committed
make sinpi/cospi return Int
1 parent 447cd05 commit 6cb6c58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/special/trig.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -927,8 +927,8 @@ function sincospi(x::T) where T<:Rational
927927
end
928928
end
929929

930-
sinpi(x::Integer) = x >= 0 ? zero(float(x)) : -zero(float(x))
931-
cospi(x::Integer) = isodd(x) ? -one(float(x)) : one(float(x))
930+
sinpi(x::T) where {T<:Integer} = zero(signed(T))
931+
cospi(x::T) where {T<:Integer} = isodd(x) ? -one(signed(T)) : one(signed(T))
932932
sincospi(x::Integer) = (sinpi(x), cospi(x))
933933
sinpi(x::Real) = sinpi(float(x))
934934
cospi(x::Real) = cospi(float(x))

0 commit comments

Comments
 (0)