Skip to content

Addition of degree + radian is unitless #537

@bc0n

Description

@bc0n
using Unitful
a = 180u"°" + 3.141u"rad"
@show unit(a)    # blank
@show typeof(a) # Float64

I expect to have to explicitly ustrip() when I want a unitless quantity.
This behavior makes certain operations type-unstable, which the docs describe and dismiss.
Much of the point of having typed functions goes away if I also have to accept floats because their input units were automatically, silently canceled.
UnitfulAngles.jl does not fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dimensionlessdimensionless quantities/units (mm/m, rad, …) and their interaction with plain numbers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions