From 121978987f4558ecd0ed99ec162b9a9af3d3f690 Mon Sep 17 00:00:00 2001 From: Will Tebbutt Date: Thu, 11 Oct 2018 16:41:27 +0100 Subject: [PATCH] Add exp10 method for Dual (#102) --- src/core.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core.jl b/src/core.jl index ca332e1b..fd013f77 100644 --- a/src/core.jl +++ b/src/core.jl @@ -250,3 +250,8 @@ function fmad_expr(f, x::Type{<:Tuple}) return body end @generated fmad(f, x) = fmad_expr(f, x) + +function Base.exp10(x::Dual) + y = exp10(DualNumbers.value(x)) + return Dual(y, y * log(10) * DualNumbers.epsilon(x)) +end