-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
From discourse:
julia> using Colors, ColorVectorSpace, LinearAlgebra, FixedPointNumbers
julia> norm(RGB(0.008,0.008,0.008))
0.008
julia> norm(RGB{N0f8}(0.008,0.008,0.008)) # spurious underflow
0.0We typically expect norm to avoid spurious underflow. It looks like you already do so for RGB{Float64}, since norm([RGB(1e-300, 1e-300, 1e-300)]) correctly returns ≈ 1e-300 rather than underflowing to zero.
I would suggest doing norm computation in the precision of the output (Float64) rather than in the precision of the input, as well as being careful about scaling.
Metadata
Metadata
Assignees
Labels
No labels