Spicy Invaders v.1.0.0
A TUI Space Invader
Loading...
Searching...
No Matches
Ch.Etml.Utils.Math2 Class Reference

Complements to the default Math class. More...

Static Public Member Functions

static int Clamp (int a, int b, int x)
 Clamps a value withing a range.
 
static double Clamp (double a, double b, double x)
 

Detailed Description

Complements to the default Math class.

Member Function Documentation

◆ Clamp() [1/2]

static double Ch.Etml.Utils.Math2.Clamp ( double a,
double b,
double x )
static

◆ Clamp() [2/2]

static int Ch.Etml.Utils.Math2.Clamp ( int a,
int b,
int x )
static

Clamps a value withing a range.

Parameters
aLower bound.
bUpper bound.
xValue to clamp.
Returns
If the value is withing the range, returns the value. Otherwise returns the lower / upper bound depending on the original value.

The documentation for this class was generated from the following file: