Skip to content

Commit ca399db

Browse files
authored
fix issue with degree variants; close issue #304 (#305)
1 parent 9087dda commit ca399db

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/mathfuns.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ degree_variants = (:sind, :cosd, :tand, :cotd, :secd, :cscd,
2828
for methvar in degree_variants
2929
meth = Symbol(String(methvar)[1:end-1])
3030
@eval begin
31-
(Base.$methvar)(ex::SymbolicObject) = ($meth)(PI*ex)
31+
(Base.$methvar)(ex::SymbolicObject) = ($meth)((PI/180)*ex)
3232
end
3333
end
3434

test/tests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,10 @@ end
565565
res = dsolve(diffeq, F(t), ics=(F, 0, 2)) # 2exp(3t)
566566
@test lambdify(res)(1) 2*exp(3*1)
567567

568+
# issue 304 wrong values for sind, ...
569+
a = Sym(45)
570+
@test sind(a) == sin(PI/4)
571+
568572
end
569573

570574
@testset "generic programming, issue 223" begin

0 commit comments

Comments
 (0)