Closed droundy closed 6 years ago
That would be great. Yeah, the only way I could see it is creating the trait and implementing it for all primitives.
You can see an example of this in Recip
Abs
probably doesn't need the associated type Output
. That is, unless we want to support types that change under absolute value. I can't think of what those would be outside of typenum
, unless we wanted to do something like have i32::abs()
return a u32
, but that is probably not useful.
Closed by #41.
It would be lovely to be able to take the absolute value of a dimensioned number. I am not sure how to do this best, but would be happy to work on a pull request. Sadly, abs does not seem to be in a trait in the standard library, so we'd need specific implementations for basically every primitive type as far as I can see?