Skip to content

Commit c295ecb

Browse files
committed
Remove unnecessary complexity from the code
1 parent 9fcc63f commit c295ecb

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

base/special/trig.jl

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -796,9 +796,7 @@ function sinpi(_x::T) where T<:IEEEFloat
796796
throw(DomainError(x, "`x` cannot be infinite."))
797797
end
798798
# For large x, answers are all 1 or zero.
799-
if T <: AbstractFloat
800-
x >= maxintfloat(T) && return copysign(zero(T), _x)
801-
end
799+
x >= maxintfloat(T) && return copysign(zero(T), _x)
802800

803801
# reduce to interval [0, 0.5]
804802
n = round(2*x)
@@ -827,9 +825,7 @@ function cospi(x::T) where T<:IEEEFloat
827825
throw(DomainError(x, "`x` cannot be infinite."))
828826
end
829827
# For large x, answers are all 1 or zero.
830-
if T <: AbstractFloat
831-
x >= maxintfloat(T) && return one(T)
832-
end
828+
x >= maxintfloat(T) && return one(T)
833829

834830
# reduce to interval [0, 0.5]
835831
n = round(2*x)
@@ -863,9 +859,7 @@ function sincospi(_x::T) where T<:IEEEFloat
863859
throw(DomainError(x, "`x` cannot be infinite."))
864860
end
865861
# For large x, answers are all 1 or zero.
866-
if T <: AbstractFloat
867-
x >= maxintfloat(T) && return (copysign(zero(T), _x), one(T))
868-
end
862+
x >= maxintfloat(T) && return (copysign(zero(T), _x), one(T))
869863

870864
# reduce to interval [0, 0.5]
871865
n = round(2*x)
@@ -905,9 +899,7 @@ function tanpi(_x::T) where T<:IEEEFloat
905899
end
906900
# For large x, answers are all zero.
907901
# All integer values for floats larger than maxintfloat are even.
908-
if T <: AbstractFloat
909-
x >= maxintfloat(T) && return copysign(zero(T), _x)
910-
end
902+
x >= maxintfloat(T) && return copysign(zero(T), _x)
911903

912904
# reduce to interval [0, 0.5]
913905
n = round(2*x)

0 commit comments

Comments
 (0)