Skip to main content

wrap

Function wrap 

Source
pub fn wrap(x: f64) -> f64
Expand description

Wrap a coordinate to prevent precision loss at large values.

This wraps the coordinate to the range [-ROUND_OFF/2, ROUND_OFF/2] to maintain numerical precision for coordinates far from the origin.

Public because BlendedNoise calls this directly on per-octave coordinates.