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
I'd say it's intentional, it doesn't make sense to compare a unitless quantity to a unitful one, they have different physical dimensions, it's like the apples to oranges comparison. I wonder if this should rather error to be loud and clear, although I can see why "false" is an appropriate answer to the question "are they approximately equal?".
I think it would be good to make the case of different dimensions error instead of returning false. The other kind of dimension mismatch (array dimension instead of physical dimension) already errors:
julia>isapprox([1,2,3], [1,2])
ERROR: DimensionMismatch: dimensions must match: a has dims (Base.OneTo(3),), b has dims (Base.OneTo(2),), mismatch at 1
However, this should probably be considered a breaking change, since the current behavior seems intentional.
The
isapprox()
definition in this package does not match that of Julia's, causing differences when units are applied versus when they are not:Yields:
The text was updated successfully, but these errors were encountered: