From f9aa0584a943f0dd963c2c4ca2305b258b782a59 Mon Sep 17 00:00:00 2001 From: Reno <25192197+singularitti@users.noreply.github.com> Date: Fri, 4 Jun 2021 22:24:22 -0400 Subject: [PATCH] Remove the type constraint on `sincosd` (#41021) Co-authored-by: Jameson Nash Co-authored-by: Steven G. Johnson --- base/special/trig.jl | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/base/special/trig.jl b/base/special/trig.jl index 363bec0e62c8c..f735ea43f2425 100644 --- a/base/special/trig.jl +++ b/base/special/trig.jl @@ -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)