Skip to content

Commit 7d43584

Browse files
singularittivtjnashstevengj
authored and
Amit Shirodkar
committed
Remove the type constraint on sincosd (JuliaLang#41021)
Co-authored-by: Jameson Nash <[email protected]> Co-authored-by: Steven G. Johnson <[email protected]>
1 parent a0534fd commit 7d43584

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

base/special/trig.jl

+3-11
Original file line numberDiff line numberDiff line change
@@ -1254,17 +1254,9 @@ Simultaneously compute the sine and cosine of `x`, where `x` is in degrees.
12541254
!!! compat "Julia 1.3"
12551255
This function requires at least Julia 1.3.
12561256
"""
1257-
function sincosd(x::Real)
1258-
if isinf(x)
1259-
return throw(DomainError(x, "sincosd(x) is only defined for finite `x`."))
1260-
elseif isnan(x)
1261-
return (oftype(x,NaN), oftype(x,NaN))
1262-
end
1263-
1264-
# It turns out that calling those functions separately yielded better
1265-
# performance than considering each case and calling `sincos_kernel`.
1266-
return (sind(x), cosd(x))
1267-
end
1257+
sincosd(x) = (sind(x), cosd(x))
1258+
# It turns out that calling these functions separately yields better
1259+
# performance than considering each case and calling `sincos_kernel`.
12681260

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

0 commit comments

Comments
 (0)