Volume Control
Application-specific hotkeys for Windows
VolumeControl.TypeExtensions.RealNumberExtensions Class Reference

Extensions for floating-point number types. More...

Collaboration diagram for VolumeControl.TypeExtensions.RealNumberExtensions:

Static Public Member Functions

static float Bound (this float value, float min, float max)
 Clamps the value between the specified min & max . More...
 
static bool EqualsWithin (this double n, double other, double epsilon=double.Epsilon)
 Compares two double types for equality using double.Epsilon. More...
 
static bool EqualsWithin (this float n, float other, float epsilon=float.Epsilon)
 Compares two float types for equality using float.Epsilon. More...
 

Detailed Description

Extensions for floating-point number types.

Member Function Documentation

◆ Bound()

static float VolumeControl.TypeExtensions.RealNumberExtensions.Bound ( this float  value,
float  min,
float  max 
)
static

Clamps the value between the specified min & max .

◆ EqualsWithin() [1/2]

static bool VolumeControl.TypeExtensions.RealNumberExtensions.EqualsWithin ( this double  n,
double  other,
double  epsilon = double.Epsilon 
)
static

Compares two double types for equality using double.Epsilon.

Parameters
nThis number.
otherA number to compare this number to.
epsilonThe epsilon comparsion threshold value.
Returns
True when n and other are less than epsilon apart.

◆ EqualsWithin() [2/2]

static bool VolumeControl.TypeExtensions.RealNumberExtensions.EqualsWithin ( this float  n,
float  other,
float  epsilon = float.Epsilon 
)
static

Compares two float types for equality using float.Epsilon.

Parameters
nThis number.
otherA number to compare this number to.
epsilonThe epsilon comparsion threshold value.
Returns
True when n and other are less than epsilon apart.

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