Commit 0aa16ede authored by Antonino D'Anna's avatar Antonino D'Anna

added abs(::uwreal)

parent 0bca4b09
......@@ -859,9 +859,31 @@ function Base.getindex(uw::uwreal, ii::Int64)
idx = getindex(value(uw), ii)
return uw # uwreal([getindex(value(uw), kwargs...), err(uw)], " ")
end
"""
Base.abs2(uw::uwreal)
Return the square absolute value.
## Warning
Previously this function returned the absolute value of `uw`, not the square absolute value.
The function was changed to make it consistent with `Base.abs2()` in Julia.
When used, a warning is printed to informe of this change future users, feel free to remove the warning
from your branch!
"""
function Base.abs2(uw::uwreal)
return (uw^2)^0.5
@warn "This function was updated by Antonino to make it consisted with the Julia version of it.
Check the documentation for info and then feel free to comment out this warning in your branch"
return uw^2
end
"""
Base.abs(uw::uwreal)
Return the absolute value of `uw` by taking the square root of `uw^2`.
"""
Base.abs(uw::uwreal) = sqrt(uw^2);
"""
Base.:*(x::uwreal, y::Matrix{uwreal})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment