Math
This class provides various static methods that wrap functionality from the System.Math class for performing mathematical operations. The class has several static methods that wrap mathematical operations:
- Abs: Calculates the absolute value of a given number
- Max: Returns the larger of two given numbers
- Min: Returns the smaller of two given numbers
- ToFixed: Converts a number to a string representation with a specified number of decimal places. The optional lcid parameter allows specifying a specific culture for formatting the number
- Round: Rounds a number to the nearest integer or to a specified number of decimal places, using the specified rounding convention
- Random: Generates a random floating-point number between 0 and 1
- Floor: Rounds a number down to the nearest integer
- Ceiling: Rounds a number up to the nearest integer
- Pow: Raises a given number to a specified power
- Sqrt: Calculates the square root of a given number
This MathWrapper class can be used as a utility class to conveniently access mathematical operations in your application. By calling the static methods of this class, you can perform various mathematical calculations without directly using the System.Math class.