Skip to content

Commit

Permalink
Remove the type constraint on sincosd (#41021)
Browse files Browse the repository at this point in the history
Co-authored-by: Jameson Nash <[email protected]>
Co-authored-by: Steven G. Johnson <[email protected]>
  • Loading branch information
3 people authored Jun 5, 2021
1 parent 3e36180 commit f9aa058
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions base/special/trig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1254,17 +1254,9 @@ Simultaneously compute the sine and cosine of `x`, where `x` is in degrees.
!!! compat "Julia 1.3"
This function requires at least Julia 1.3.
"""
function sincosd(x::Real)
if isinf(x)
return throw(DomainError(x, "sincosd(x) is only defined for finite `x`."))
elseif isnan(x)
return (oftype(x,NaN), oftype(x,NaN))
end

# It turns out that calling those functions separately yielded better
# performance than considering each case and calling `sincos_kernel`.
return (sind(x), cosd(x))
end
sincosd(x) = (sind(x), cosd(x))
# It turns out that calling these functions separately yields better
# performance than considering each case and calling `sincos_kernel`.

sincosd(::Missing) = (missing, missing)

Expand Down

0 comments on commit f9aa058

Please sign in to comment.