BaseType
Documentation for BaseType.
BaseType.base_numeric_type
— Methodbase_numeric_type(::Type{T}) where {T}
base_numeric_type(x::T)
Extract the base numeric type from a numerical type T
such as a measurement or a quantity.
For example,
Input Type | Output Type |
---|---|
Float32 | Float32 |
ComplexF32 | Float32 |
Measurement{Float32} | Float32 |
Dual{BigFloat} | BigFloat |
Rational{Int8} | Int8 |
Quantity{Float32, ...} | Float32 |
Quantity{Measurement{Float32}, ...} | Float32 |
Dual{Complex{Float32}} | Float32 |
The standard behavior is to return the first type parameter, or, if that type has parameters of its own (such as Dual{Complex{Float32}}
), to recursively take the first type parameter until a non-parameterized type is found.