Skip to content

Broadcast product of a Gain with a range loses Gain units #786

@DylanMMarques

Description

@DylanMMarques

Hi,

Multiplying a range by a Gain loses the Gain units:

(5u"dB"/u"cm") .* (1:10)
# (5:5:50) cm^-1

Works fine with normal arrays:

(5u"dB"/u"cm") .* collect(1:10)
# 10-element Vector{Quantity{Gain{Unitful.LogInfo{:Decibel, 10, 10}, :?, Int64}, 𝐋^-1, Unitful.FreeUnits{(cm^-1,), 𝐋^-1, nothing}}}:
# [5 dB] cm^-1
# [10 dB] cm^-1
# [15 dB] cm^-1
# [20 dB] cm^-1
# [25 dB] cm^-1
# [30 dB] cm^-1
# [35 dB] cm^-1
# [40 dB] cm^-1
# [45 dB] cm^-1
# [50 dB] cm^-1

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    logarithmiclogarithmic scales (decibels, nepers, …)rangesranges (StepRange, StepRangeLen) of quantities

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions