Class MathUtility
Mathematical utility functions for common calculations.
Namespace: NWH.Common
Assembly: NWH.Common.dll
Syntax
public static class MathUtility
Methods
| Edit this page View SourceClampWithRemainder(ref float, in float, out float)
Clamps a value to a range and outputs how much it exceeded the range. Useful for clamping values while preserving overflow information.
Declaration
public static void ClampWithRemainder(ref float x, in float range, out float remainder)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | Value to clamp (will be modified). |
| float | range | Range limit (value will be clamped to [-range, +range]). |
| float | remainder | Amount by which x exceeded the range (output). |