RMath Type

Provides methods for real numbers, that were forgotten by the Math class.

Static members

Static member Description

RMath.Acosh(x)

Full Usage: RMath.Acosh(x)

Parameters:
    x : float

Returns: float

x : float
Returns: float

RMath.Asinh(x)

Full Usage: RMath.Asinh(x)

Parameters:
    x : float

Returns: float

x : float
Returns: float

RMath.Atanh(x)

Full Usage: RMath.Atanh(x)

Parameters:
    x : float

Returns: float

x : float
Returns: float

RMath.ClampToInterval(x, xmin, xmax)

Full Usage: RMath.ClampToInterval(x, xmin, xmax)

Parameters:
    x : float - The x value.
    xmin : float - The interval minimum.
    xmax : float - The interval maximum.

Returns: float The value x clamped to the interval [xmin, xmax]. If Double.NaN is provided, the return value is Double.NaN.

Clamps the value x to the interval [xmin, xmax]. If Double.NaN is provided, the return value is Double.NaN.

x : float

The x value.

xmin : float

The interval minimum.

xmax : float

The interval maximum.

Returns: float

The value x clamped to the interval [xmin, xmax]. If Double.NaN is provided, the return value is Double.NaN.

RMath.Hypot(x, y)

Full Usage: RMath.Hypot(x, y)

Parameters:
    x : float - First argument.
    y : float - Second argument.

Returns: float Square root of the sum of x-square and y-square.

The standard hypot() function for two arguments taking care of overflows and zerodivides.

x : float

First argument.

y : float

Second argument.

Returns: float

Square root of the sum of x-square and y-square.

RMath.InFractionOfUnorderedIntervalCC(x, leftValue, rightValue)

Full Usage: RMath.InFractionOfUnorderedIntervalCC(x, leftValue, rightValue)

Parameters:
    x : float - The x value.
    leftValue : float - The left value of the interval, might be less than or greater than rightValue.
    rightValue : float - The right value of the interval, might be less than or greater han leftValue.

Returns: Nullable<float>

If x is inside the interval [leftValue, rightValue] or [rightValue, leftValue], then this function returns a value in the range [0,1] designating the (linear) position inside that interval. I.e. if rightValue > leftValue, the return value would be (x-leftValue)/(rightValue-leftValue).

x : float

The x value.

leftValue : float

The left value of the interval, might be less than or greater than rightValue.

rightValue : float

The right value of the interval, might be less than or greater han leftValue.

Returns: Nullable<float>

RMath.InterpolateLinear(fraction, leftValue, rightValue)

Full Usage: RMath.InterpolateLinear(fraction, leftValue, rightValue)

Parameters:
    fraction : float - The fraction value.
    leftValue : float - The left value.
    rightValue : float - The right value.

Returns: float (1-fraction)*leftValue + fraction*rightValue. If fraction is either 0 or 1, only the leftValue or the rightValue will be used as return value, respectively.

Interpolates linearly between leftValue and rightValue, using the parameter fraction.

fraction : float

The fraction value.

leftValue : float

The left value.

rightValue : float

The right value.

Returns: float

(1-fraction)*leftValue + fraction*rightValue. If fraction is either 0 or 1, only the leftValue or the rightValue will be used as return value, respectively.

RMath.InterpolateLinear(index, array, ?extendToSides)

Full Usage: RMath.InterpolateLinear(index, array, ?extendToSides)

Parameters:
    index : float - The index into the array. Can be fractional.
    array : float[] - The array.
    ?extendToSides : bool - If true and the value of index is out of range, the values of the array at the left side or the right side will be returned; otherwise, if the index is out of range, an exception will be thrown.

Returns: float The interpolated value at the fractional index.

Interpolates values of an array.

index : float

The index into the array. Can be fractional.

array : float[]

The array.

?extendToSides : bool

If true and the value of index is out of range, the values of the array at the left side or the right side will be returned; otherwise, if the index is out of range, an exception will be thrown.

Returns: float

The interpolated value at the fractional index.

RMath.IsFinite(x)

Full Usage: RMath.IsFinite(x)

Parameters:
    x : float - Number to test.

Returns: bool True if x is finite. False if is is not finite or is double.NaN.

Tests if x is finite, i.e. is in the interval [double.MinValue, double.MaxValue].

x : float

Number to test.

Returns: bool

True if x is finite. False if is is not finite or is double.NaN.

RMath.IsFinite(x)

Full Usage: RMath.IsFinite(x)

Parameters:
    x : float32 - Number to test.

Returns: bool True if x is finite. False if is is not finite or is double.NaN.

Tests if x is finite, i.e. is in the interval [float.MinValue, float.MaxValue].

x : float32

Number to test.

Returns: bool

True if x is finite. False if is is not finite or is double.NaN.

RMath.IsInIntervalCC(x, xmin, xmax)

Full Usage: RMath.IsInIntervalCC(x, xmin, xmax)

Parameters:
    x : float - The argument.
    xmin : float - The lower boundary of the interval.
    xmax : float - The upper boundary of the interval.

Returns: bool True if xmin <= x and x <= xmax.

Tests whether or not x is in the closed interval [xmin, xmax]. No test is done if xmin is less than xmax.

x : float

The argument.

xmin : float

The lower boundary of the interval.

xmax : float

The upper boundary of the interval.

Returns: bool

True if xmin <= x and x <= xmax.

RMath.IsInIntervalCO(x, xmin, xmax)

Full Usage: RMath.IsInIntervalCO(x, xmin, xmax)

Parameters:
    x : float - The argument.
    xmin : float - The lower boundary of the interval.
    xmax : float - The upper boundary of the interval.

Returns: bool True if xmin <= x and x < xmax.

Tests whether or not x is in the semi-open interval [xmin, xmax). No test is done if xmin is less than xmax.

x : float

The argument.

xmin : float

The lower boundary of the interval.

xmax : float

The upper boundary of the interval.

Returns: bool

True if xmin <= x and x < xmax.

RMath.IsInIntervalOC(x, xmin, xmax)

Full Usage: RMath.IsInIntervalOC(x, xmin, xmax)

Parameters:
    x : float - The argument.
    xmin : float - The lower boundary of the interval.
    xmax : float - The upper boundary of the interval.

Returns: bool True if xmin < x and x <= xmax.

Tests whether or not x is in the semi-open interval (xmin, xmax]. No test is done if xmin is less than xmax.

x : float

The argument.

xmin : float

The lower boundary of the interval.

xmax : float

The upper boundary of the interval.

Returns: bool

True if xmin < x and x <= xmax.

RMath.IsInIntervalOO(x, xmin, xmax)

Full Usage: RMath.IsInIntervalOO(x, xmin, xmax)

Parameters:
    x : float - The argument.
    xmin : float - The lower boundary of the interval.
    xmax : float - The upper boundary of the interval.

Returns: bool True if xmin < x and x < xmax.

Tests whether or not x is in the open interval (xmin, xmax). No test is done if xmin is less than xmax.

x : float

The argument.

xmin : float

The lower boundary of the interval.

xmax : float

The upper boundary of the interval.

Returns: bool

True if xmin < x and x < xmax.

RMath.IsNaN(x)

Full Usage: RMath.IsNaN(x)

Parameters:
    x : float - Number to test.

Returns: bool True if x is NaN.

Test if x is not a number.

x : float

Number to test.

Returns: bool

True if x is NaN.

RMath.IsNaN(x)

Full Usage: RMath.IsNaN(x)

Parameters:
    x : float32 - Number to test.

Returns: bool True if x is NaN.

Test if x is not a number.

x : float32

Number to test.

Returns: bool

True if x is NaN.

RMath.Log1p(x)

Full Usage: RMath.Log1p(x)

Parameters:
    x : float

Returns: float

x : float
Returns: float

RMath.OneMinusExp(x)

Full Usage: RMath.OneMinusExp(x)

Parameters:
    x : float - Function argument

Returns: float The value 1-Exp(x)

Calculates 1-Exp(x) with better accuracy around x=0.

x : float

Function argument

Returns: float

The value 1-Exp(x)

RMath.Pow(x, n)

Full Usage: RMath.Pow(x, n)

Parameters:
    x : float -
    n : int -

Returns: float

Calculates x^n by repeated multiplications. The algorithm takes ld(n) multiplications. This algorithm can also be used with negative n.

x : float

n : int

Returns: float

RMath.Pow(x, n)

Full Usage: RMath.Pow(x, n)

Parameters:
    x : float -
    n : int64 -

Returns: float

Calculates x^n by repeated multiplications. The algorithm takes ld(n) multiplications. This algorithm can also be used with negative n.

x : float

n : int64

Returns: float

RMath.Pow2(x)

Full Usage: RMath.Pow2(x)

Parameters:
    x : float - Argument.

Returns: float x squared.

Calculates x^2 (square of x).

x : float

Argument.

Returns: float

x squared.

RMath.Pow3(x)

Full Usage: RMath.Pow3(x)

Parameters:
    x : float

Returns: float

x : float
Returns: float

RMath.Pow4(x)

Full Usage: RMath.Pow4(x)

Parameters:
    x : float

Returns: float

x : float
Returns: float

RMath.Pow5(x)

Full Usage: RMath.Pow5(x)

Parameters:
    x : float

Returns: float

x : float
Returns: float

RMath.Pow6(x)

Full Usage: RMath.Pow6(x)

Parameters:
    x : float

Returns: float

x : float
Returns: float

RMath.Pow7(x)

Full Usage: RMath.Pow7(x)

Parameters:
    x : float

Returns: float

x : float
Returns: float

RMath.Pow8(x)

Full Usage: RMath.Pow8(x)

Parameters:
    x : float

Returns: float

x : float
Returns: float

RMath.Pow9(x)

Full Usage: RMath.Pow9(x)

Parameters:
    x : float

Returns: float

x : float
Returns: float

RMath.ScaleDecadic(x, n)

Full Usage: RMath.ScaleDecadic(x, n)

Parameters:
    x : float - The scaling factor.
    n : int - The decadic exponent.

Returns: float The product x * 10^n.

Calculates x * 10^n.

x : float

The scaling factor.

n : int

The decadic exponent.

Returns: float

The product x * 10^n.