Skip to content

Commit f88637e

Browse files
committed
Moved Base.exp, Base.cos, and Base.sin definitions to Furlongs module
1 parent 3ef7c37 commit f88637e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test/DerivativeTest.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@ end
115115
end
116116

117117
@testset "non-standard numbers" begin
118-
Base.exp(f::Furlongs.Furlong{0}) = exp(f.val)
119-
Base.cos(f::Furlongs.Furlong{0}) = cos(f.val)
120-
Base.sin(f::Furlongs.Furlong{0}) = sin(f.val)
121-
122118
furlong = Furlongs.Furlong{2}(1.0)
123119

124120
f(x) = exp(x) + 4*sin(x)*oneunit(x)

test/Furlongs.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,8 @@ Base.muladd(x::TNumber, y::TNumber, z::Furlong) = x*y + z
107107
Base.muladd(x::TNumber, y::Furlong, z::Furlong) = x*y + z
108108
Base.muladd(x::Furlong, y::TNumber, z::Furlong) = x*y + z
109109

110+
Base.exp(f::Furlongs.Furlong{0}) = exp(f.val)
111+
Base.cos(f::Furlongs.Furlong{0}) = cos(f.val)
112+
Base.sin(f::Furlongs.Furlong{0}) = sin(f.val)
113+
110114
end

0 commit comments

Comments
 (0)