Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert to multiplication for radian-degree conversion #4114

Merged
merged 1 commit into from
Aug 20, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions base/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,8 @@ cosc(x::Integer) = cosc(float(x))
cosc{T<:Integer}(x::Complex{T}) = cosc(complex(float(real(x)),float(imag(x))))
@vectorize_1arg Number cosc

const pideg1 = 0.017453292501159012 # pi/180 truncated to 29 significant bits
const pideg2 = 1.8784283451579438e-11 # pi/180 - pideg1
const degpi1 = 57.29577946662903 # 180/pi to 29 significant bits
const degpi2 = 4.645329255648566e-8 # 180/pi - degpi1

radians2degrees(z::Real) = oftype(z, degpi1*z + degpi2*z)
degrees2radians(z::Real) = oftype(z, pideg1*z + pideg2*z)
radians2degrees(z::Real) = oftype(z, 57.29577951308232*z)
degrees2radians(z::Real) = oftype(z, 0.017453292519943295*z)
radians2degrees(z::Integer) = radians2degrees(float(z))
degrees2radians(z::Integer) = degrees2radians(float(z))

Expand Down