-
Couldn't load subscription status.
- Fork 122
Description
This comparison fails:
1u"m" < Inf
ERROR: DimensionError: 1.0 m and Inf are not dimensionally compatible.where I think most users would expect to be true because ±Inf should not need to have units.
Now x = 1u"m"; x > 0 also fails but here we have the acceptable alternative x > zero(x).
But there (apparently) is no analog like infinity(x) so we are stuck with Inf.
These are the key lines:
https://github.com/PainterQubits/Unitful.jl/blob/1e78e6b036144d70039b536de747dc1e83355997/src/quantities.jl#L265
https://github.com/PainterQubits/Unitful.jl/blob/1e78e6b036144d70039b536de747dc1e83355997/src/quantities.jl#L274
That last line could check for ±Inf instead of always throwing an error. The performance hit would be small because that line only gets used in the error condition. Would a PR be welcome?
I search all issue for Inf and found nothing and found just 2 issues that concern isless: #399 #30