JuliaDiff / DualNumbers.jl

Julia package for representing dual numbers and for performing dual algebra
Other
80 stars 30 forks source link

better fix for domain errors in pow() #34

Closed mlubin closed 8 years ago

mlubin commented 8 years ago

Before:

julia> Dual(-2.0,1.0)^2.0
4.0 - 4.0ɛ

julia> Dual(-2.0,1.0)^Dual(2.0,0.0)
ERROR: DomainError:
 in ^ at /home/mlubin/.julia/v0.4/DualNumbers/src/dual.jl:234

After:

julia> Dual(-2.0,1.0)^Dual(2.0,0.0)
4.0 - 4.0ɛ
timholy commented 8 years ago

LGTM.

timholy commented 8 years ago

Tag?