Skip to content

Generic functions that use uom sqrt() #339

@jacg

Description

@jacg

How would one write a generic function that uses Quantity::sqrt()?

Here is a toy example:

fn pythagoras<D, U>(a: Quantity<D, U, f32>, b: Quantity<D, U, f32>) -> Quantity<D, U, f32> 
where
       ??? ,
{
    (a*a + b*b).sqrt()
}

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