BaseType.base_numeric_typeMethod
base_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 TypeOutput Type
Float32Float32
ComplexF32Float32
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.