Open
Description
These methods are quite useful whenever you have to make sure that a value stays inside a specified range. Although there is f32::clamp
and f64::clamp
these are not stabilized yet so it would be nice to have them inside cgmath
.
wraparound
should have a signature like this:
fn wraparound<S>(x: S, min: S, max: S) -> S
See also https://stackoverflow.com/questions/4633177/c-how-to-wrap-a-float-to-the-interval-pi-pi#
Metadata
Metadata
Assignees
Labels
No labels