You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERROR: DimensionError: m and NaN are not dimensionally compatible.
Stacktrace:
[1] hypot(::Unitful.Quantity{Float64,Unitful.Dimensions{(Unitful.Dimension{:Length}(1//1),)},Unitful.FreeUnits{(Unitful.Unit{:Meter,Unitful.Dimensions{(Unitful.Dimension{:Length}(1//1),)}}(0, 1//1),),Unitful.Dimensions{(Unitful.Dimension{:Length}(1//1),)}}}, ::Unitful.Quantity{Float64,Unitful.Dimensions{(Unitful.Dimension{:Length}(1//1),)},Unitful.FreeUnits{(Unitful.Unit{:Meter,Unitful.Dimensions{(Unitful.Dimension{:Length}(1//1),)}}(0, 1//1),),Unitful.Dimensions{(Unitful.Dimension{:Length}(1//1),)}}}) at ./math.jl:475
The same issue occurs for @fastmath hypot, but does not occur when more arguments are passed: hypot(0m, 0m, 0m) evaluates to 0m.
Currently I get around this with:
function Base.hypot(x::Unitful.Quantity, y::Unitful.Quantity)
if iszero(x) && iszero(y)
return zero(x)
else
return hypot(x, y)
end
end
but this is a band-aid, so I wanted to open this issue in case there is a better way.
The text was updated successfully, but these errors were encountered:
On Julia 0.6.2:
gives the error:
The same issue occurs for
@fastmath hypot
, but does not occur when more arguments are passed:hypot(0m, 0m, 0m)
evaluates to0m
.Currently I get around this with:
but this is a band-aid, so I wanted to open this issue in case there is a better way.
The text was updated successfully, but these errors were encountered: