Skip to content

Suggestion: allow multiplying by a unit #366

Open
@ttencate

Description

@ttencate

The dimensioned crate allows us to multiply raw float values with a unit to produce a quantity:

let length: Meter<f64> = 3.0 * M;

In uom, this would look like:

let length: Length = 3.0 * meter;

Similarly, division f64 / Unit could be useful:

let frequency: Frequency = 5.0 / second;

For consistency, also allow Unit / f64:

let one_minute = hour / 60.0;

Essentially, a value that implements Unit could be used wherever a quantity of that dimension is expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions