Skip to content

Unable to clamp quantity to a range. #440

Closed
@DJDuque

Description

@DJDuque

I am not sure if this is the expected behavior, but the following fails for me (I would expect it to work):

use uom::si::angle::radian;
use uom::si::f64::Angle;

fn main() {
    let x = Angle::new::<radian>(5.0);
    let clamped = x.clamp(-Angle::HALF_TURN, Angle::HALF_TURN);
}

I am not very familiar with the code under the hood, but looking here it looks like this should work (?).

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