-
Couldn't load subscription status.
- Fork 122
Open
Labels
Description
Currently, Unitful quantities are <: Number but not <: Real. This hinders composability with other libraries.
Just a few examples for methods that accept Reals and don't work with units - but actually should and totally make sense:
Base.searchsorted(::AbstractRange{<:Real}, ::Real)does division instead of performing binary search - so, it's faster than AbstractArray fallbackStatsBase.weightsrequireAbstractVector{<:Real}
Surely there are much more.
Note that these methods are correctly restricted to reals: they don't make sense for complex numbers.
Why not make Quantity <: Real, and use Complex{Quantity} for complex unitful values?
mvsoomnsajko