Julia 1.13 introduces the ispositive and isnegative functions. We should add methods for quantities.
However, some cases might be controversial:
- Is
-3°C negative? It is equal to 270.15K, which is positive.
- What about
-3dB and -3dBFS? For now, I wouldn’t add ispositive and isnegative methods for them, since they cannot be compared to numbers anyway (-3dB < 0 and -3dBFS < 0 both error).
Another case that I consider slightly less relevant:
- One can define a unit that is equal to negative meters (
@unit negm "negm" NegativeMeter -1m false). Is 1negm (which is equal to -1m) negative or positive? Probably positive, since 1negm < 2negm. However, the fact that 1negm < 2negm but uconvert(m, 1negm) > uconvert(m, 2negm) shows that these units don’t behave nicely anyway. Maybe we could just consider them malformed and don’t pay them any attention.
Julia 1.13 introduces the
ispositiveandisnegativefunctions. We should add methods for quantities.However, some cases might be controversial:
-3°Cnegative? It is equal to270.15K, which is positive.-3dBand-3dBFS? For now, I wouldn’t addispositiveandisnegativemethods for them, since they cannot be compared to numbers anyway (-3dB < 0and-3dBFS < 0both error).Another case that I consider slightly less relevant:
@unit negm "negm" NegativeMeter -1m false). Is1negm(which is equal to-1m) negative or positive? Probably positive, since1negm < 2negm. However, the fact that1negm < 2negmbutuconvert(m, 1negm) > uconvert(m, 2negm)shows that these units don’t behave nicely anyway. Maybe we could just consider them malformed and don’t pay them any attention.