Skip to content

Commit c7b35e7

Browse files
committed
Moved Base.exp, Base.cos, and Base.sin definitions to Furlongs module
1 parent 712742e commit c7b35e7

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
@@ -135,10 +135,6 @@ end
135135
end
136136

137137
@testset "non-standard numbers" begin
138-
Base.exp(f::Furlongs.Furlong{0}) = exp(f.val)
139-
Base.cos(f::Furlongs.Furlong{0}) = cos(f.val)
140-
Base.sin(f::Furlongs.Furlong{0}) = sin(f.val)
141-
142138
furlong = Furlongs.Furlong{2}(1.0)
143139

144140
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)