Closed IainNZ closed 10 years ago
This works,
julia> sqrt(Dual(0.0,1.0))
dual(0.0,Inf)
For Dual(0.0)
, it's computing 0.0*Inf
which gives NaN
. Should it be something else?
I'm not sure... I had something where I was changing the (x,y) coordinates of things and minimizing the Euclidean distance of points, but I didn't bother excluding the case where i=j, which is what gave me the Dual(0.0) to start with, e.g. I had what basically turned into sqrt(Dual(0.0) + Dual(0.0)). In that case, at least, it should be 0.0
, I guess. I'm more generally surprised Julia defines 0.0 * Inf as NaN, I thought it would be 0.0
Pretty sure that 0.0*Inf==NaN
is a standard floating point rule. Okay to close this?
Oh yeah it seems standard. If someone ever files an issue about strange NaNs though, this should be first place to look.
So this surprised me... whats the intution behind it?