From aff84177e85ff3b9b50b35430b0951514a721345 Mon Sep 17 00:00:00 2001 From: Miha Zgubic Date: Fri, 9 Sep 2022 12:15:32 +0200 Subject: [PATCH] get around ambiguities in base --- test/demos/forwarddiffzero.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/demos/forwarddiffzero.jl b/test/demos/forwarddiffzero.jl index ae93459..8857365 100644 --- a/test/demos/forwarddiffzero.jl +++ b/test/demos/forwarddiffzero.jl @@ -56,6 +56,11 @@ end # !Important!: Attach the define function to the `on_new_rule` hook on_new_rule(define_dual_overload, frule) +# get around ambiguities in Base +Base.:(+)(x::Float64, y::Float64) = Base.add_float(x, y) +Base.:(-)(x::Float64, y::Float64) = Base.sub_float(x, y) +Base.:(*)(x::Float64, y::Float64) = Base.mul_float(x, y) + "Do a calculus. `f` should have a single input." function derv(f, arg) duals = Dual(arg, one(arg))