Skip to content

Commit 8d17649

Browse files
authored
Remove code for Julia <1.6 (#804)
1 parent c6802af commit 8d17649

File tree

5 files changed

+122
-180
lines changed

5 files changed

+122
-180
lines changed

src/Unitful.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Base: min, max, floor, ceil, real, imag, conj
77
import Base: complex, widen, reim # handled in complex.jl
88
import Base: exp, exp10, exp2, expm1, log, log10, log1p, log2
99
import Base: sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh,
10-
sinpi, cospi, sinc, cosc, cis, sincos
10+
sinpi, cospi, sinc, cosc, cis, cispi, sincos
1111
import Base: eps, mod, rem, div, fld, cld, divrem, trunc, round, sign, signbit
1212
import Base: isless, isapprox, isinteger, isreal, isinf, isfinite, isnan
1313
import Base: copysign, flipsign

src/pkgdefaults.jl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,19 +110,12 @@ const AbsoluteScaleTemperature = Quantity{T, 𝚯, <:ScalarUnits} where T
110110
\nDimension: [`Unitful.NoDims`](@ref)."
111111
((@unit ° "°" Degree pi/180 false), const deg = °)
112112
# For numerical accuracy, specific to the degree
113-
import Base: sind, cosd, tand, secd, cscd, cotd
114-
for (_x,_y) in ((:sin,:sind), (:cos,:cosd), (:tan,:tand),
113+
import Base: sind, cosd, sincosd, tand, secd, cscd, cotd
114+
for (_x,_y) in ((:sin,:sind), (:cos,:cosd), (:sincos,:sincosd), (:tan,:tand),
115115
(:sec,:secd), (:csc,:cscd), (:cot,:cotd))
116116
@eval ($_x)(x::Quantity{T, NoDims, typeof(°)}) where {T} = ($_y)(ustrip(x))
117117
@eval ($_y)(x::Quantity{T, NoDims, typeof(°)}) where {T} = ($_y)(ustrip(x))
118118
end
119-
if isdefined(Base, :sincosd)
120-
import Base: sincosd
121-
sincos(x::Quantity{T, NoDims, typeof(°)}) where {T} = sincosd(ustrip(x))
122-
sincosd(x::Quantity{T, NoDims, typeof(°)}) where {T} = sincosd(ustrip(x))
123-
else
124-
sincos(x::Quantity{T, NoDims, typeof(°)}) where {T} = (u = ustrip(x); (sind(u), cosd(u)))
125-
end
126119
for f in (:cos, :sin, :tan, :sincos, :cis)
127120
f_fast = fast_op[f]
128121
# Use deg2rad because uncnvert only has Float64 precision

src/quantities.jl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,8 @@ for _y in (:sin, :cos, :tan, :asin, :acos, :atan, :sinh, :cosh, :tanh, :asinh, :
213213
end
214214
cis(x::DimensionlessQuantity{<:Real}) = Complex(reverse(sincos(x))...)
215215
cis(x::DimensionlessQuantity{<:Complex}) = exp(-imag(x)) * cis(real(x))
216-
if isdefined(Base, :cispi)
217-
import Base: cispi
218-
Base.cispi(x::DimensionlessQuantity{<:Real}) = Complex(reverse(sincospi(x))...)
219-
Base.cispi(x::DimensionlessQuantity{<:Complex}) = exp(-*imag(x))) * cispi(real(x))
220-
end
216+
cispi(x::DimensionlessQuantity{<:Real}) = Complex(reverse(sincospi(x))...)
217+
cispi(x::DimensionlessQuantity{<:Complex}) = exp(-*imag(x))) * cispi(real(x))
221218

222219
atan(y::AbstractQuantity{T1,D,U1}, x::AbstractQuantity{T2,D,U2}) where {T1,T2,D,U1,U2} =
223220
atan(promote(y,x)...)

0 commit comments

Comments
 (0)