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

docs for sinpi, vectorize sinpi/sind #4121

Merged
merged 1 commit into from
Aug 21, 2013
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions base/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ function cospi(z::Complex)
pizi = pi*zi
complex(cospi(zr)*cosh(pizi), -sinpi(zr)*sinh(pizi))
end
@vectorize_1arg Number sinpi
@vectorize_1arg Number cospi


sinc(x::Number) = x==0 ? one(x) : oftype(x,sinpi(x)/(pi*x))
sinc(x::Integer) = x==0 ? one(x) : zero(x)
Expand Down Expand Up @@ -179,6 +182,7 @@ function sind(x::Real)
return sin(degrees2radians(rx))
end
end
@vectorize_1arg Real sind

function cosd(x::Real)
if isinf(x)
Expand All @@ -205,8 +209,10 @@ function cosd(x::Real)
return cos(degrees2radians(rx))
end
end
@vectorize_1arg Real cosd

tand(x::Real) = sind(x) / cosd(x)
@vectorize_1arg Real tand

for (fd, f) in ((:sind, :sin), (:cosd, :cos), (:tand, :tan))
@eval begin
Expand Down
Loading