URL: https://graphicscomputing.fr/cgp/reference/functions/scalar-math/
Description: abs, clamp and linear interpolation of numbers, and comparisons with a tolerance.

# Scalar math and comparisons

abs, clamp and linear interpolation of numbers, and comparisons with a tolerance.

- `char abs(char a)` - Absolute value of a signed char.
- `double abs(double a)` - Absolute value of a double (std::abs).
- `float abs(float a)` - Absolute value of a float (std::abs).
- `int abs(int a)` - Absolute value of a signed int.
- `long long abs(long long a)` - Absolute value of a signed long long.
- `long abs(long a)` - Absolute value of a signed long.
- `short abs(short a)` - Absolute value of a signed short.
- `unsigned char abs(unsigned char a)` - Absolute value of an unsigned integer, i.e. the value itself.
- `unsigned int abs(unsigned int a)` - Absolute value of an unsigned integer, i.e. the value itself.
- `unsigned long long abs(unsigned long long a)` - Absolute value of an unsigned integer, i.e. the value itself.
- `unsigned long abs(unsigned long a)` - Absolute value of an unsigned integer, i.e. the value itself.
- `unsigned short abs(unsigned short a)` - Absolute value of an unsigned integer, i.e. the value itself.
- `T1 clamp(T1 x, T2 x_min, T2 x_max)` - Clamps x to the interval [x_min, x_max].
- `T interpolation_linear(float alpha, T const& value_0, T const& value_1)` - Linear interpolation (1-alpha)*value_0 + alpha*value_1, with alpha expected in [0,1].
- `bool is_equal(char const* a, std::string const& b)` - Exact equality of a C-string and a string.
- `bool is_equal(double a, double b)` - Approximate equality of two doubles: true if |a-b| <= 1e-7.
- `bool is_equal(double a, float b)` - Approximate equality of a double and a float, compared in float precision with tolerance 1e-5.
- `bool is_equal(float a, double b)` - Approximate equality of a float and a double, compared in float precision with tolerance 1e-5.
- `bool is_equal(float a, float b)` - Approximate equality of two floats: true if |a-b| <= 1e-5.
- `bool is_equal(std::string const& a, char const* b)` - Exact equality of a string and a C-string.
- `bool is_equal(std::string const& a, std::string const& b)` - Exact equality of two strings.
- `bool is_equal(std::array<T1,N> const& a, std::array<T2,N> const& b)` - Element-wise equality of two std::array, approximate for floating-point elements.
- `bool is_equal(T1 const& a, T2 const& b)` - Generic fallback equality test using operator== (exact comparison).
- `bool is_equal(std::vector<T1> const& a, std::vector<T2> const& b)` - Element-wise equality of two std::vector, approximate for floating-point elements; false if sizes differ.
