For Levels (and mixed quantities based on Levels), unit discards the logarithmic part, dimension does not:
julia> unit(5u"dBV") # NoUnits
julia> dimension(5u"dBV") # voltage
π^2 π π^-1 π^-3
julia> unit(5u"dBV*m") # meters (a length)
m
julia> dimension(5u"dBV*m") # voltage * length
π^3 π π^-1 π^-3
I think the behavior of dimension makes sense. To fix unit, there are two possibilities:
- Use the
unit of the reflevel, i.e., unit(5u"dBV") == V
- Make
unit(::Level) throw an error
Edit: Related: #528.
For
Levels (and mixed quantities based onLevels),unitdiscards the logarithmic part,dimensiondoes not:I think the behavior of
dimensionmakes sense. To fixunit, there are two possibilities:unitof thereflevel, i.e.,unit(5u"dBV") == Vunit(::Level)throw an errorEdit: Related: #528.