Basic functions.
Constructor | Description |
Full Usage:
BasicFunctions()
|
|
Static member | Description |
Full Usage:
BasicFunctions.CopySign(x, y)
Parameters:
float
-
The first number.
y : float
-
The second number whose sign is used.
Returns: float
The first number x with the sign of the second argument y.
|
Return first number with the sign of second number
|
Full Usage:
BasicFunctions.LogRel(x)
Parameters:
float
-
The function argument.
Returns: float
|
LogRel(z) = log(1+z) with relative error accuracy near z = 0.
June 1977 edition. W. Fullerton, c3, Los Alamos Scientific Lab. series for alnr on the interval -3.75000e-01 to 3.75000e-01 with weighted error 6.35e-32 log weighted error 31.20 significant figures required 30.93 decimal places required 32.01
|
Full Usage:
BasicFunctions.LogRel(x, bDebug)
Parameters:
float
-
The function argument.
bDebug : bool
-
If true, an exception will be thrown if errors occur, if false, double.NaN is returned in this case.
Returns: float
|
LogRel(z) = log(1+z) with relative error accuracy near z = 0.
June 1977 edition. W. Fullerton, c3, Los Alamos Scientific Lab. series for alnr on the interval -3.75000e-01 to 3.75000e-01 with weighted error 6.35e-32 log weighted error 31.20 significant figures required 30.93 decimal places required 32.01
|
|
LogRel(z) = log(1+z) with relative error accuracy near z = 0.
April 1977 version. W. Fullerton, c3, Los Alamos Scientific Lab. let rho = abs(z) and r**2 = abs(1+z)**2 = (1+x)**2 + y**2 = 1 + 2*x + rho**2 . now if rho is small we may evaluate LogRel(z) accurately by log(1+z) = complex (log(r), arg(1+z)) = complex (0.5*log(r**2), arg(1+z)) = complex (0.5*LogRel(2*x+rho**2), arg(1+z))
|
|
LogRel(z) = log(1+z) with relative error accuracy near z = 0.
April 1977 version. W. Fullerton, c3, Los Alamos Scientific Lab. let rho = abs(z) and r**2 = abs(1+z)**2 = (1+x)**2 + y**2 = 1 + 2*x + rho**2 . now if rho is small we may evaluate LogRel(z) accurately by log(1+z) = complex (log(r), arg(1+z)) = complex (0.5*log(r**2), arg(1+z)) = complex (0.5*LogRel(2*x+rho**2), arg(1+z))
|
Full Usage:
BasicFunctions.Nint(d)
Parameters:
float
-
The argument.
Returns: int
The nearest integer of the argument d.
|
Round to nearest integer.
|
Full Usage:
BasicFunctions.NumberOfWraps(len, start, offset)
Parameters:
int
-
Length of the range.
start : int
-
Start point.
offset : int
-
Offset.
Returns: int
Number of range wraps when going from start to start+offset. In case offset is negative,
the function returns a negative value.
|
Calculates the number of wraps w. This is the number of range wraps that must be taken to go from start to start+offset.
|
Full Usage:
BasicFunctions.PMod(x, y)
Parameters:
int
-
Nominator.
y : int
-
Denominator.
Returns: int
The remainder of the division x by y, but guaranted to be in the positive range.
|
Modulus x%y, but with result guaranted to be greater or equal to zero.
|
Full Usage:
BasicFunctions.hypot (x, y, z)
Parameters:
float32
-
First argument.
y : float32
-
Second argument.
z : float32
-
Third argument.
Returns: float32
Square root of the sum of x-square, y-square and z-square.
|
The standard hypot() function for three arguments taking care of overflows and zerodivides.
|
Full Usage:
BasicFunctions.hypot (x, y, z)
Parameters:
float
-
First argument.
y : float
-
Second argument.
z : float
-
Third argument.
Returns: float
Square root of the sum of x-square, y-square and z-square.
|
The standard hypot() function for three arguments taking care of overflows and zerodivides.
|
Full Usage:
BasicFunctions.sign x
Parameters:
float
-
The number whose sign is returned.
Returns: int
-1 if the argument is negative, 0 if the argument is zero, or 1 if argument is positive.
|
Returns -1 if argument negative, 0 if argument zero, or 1 if argument is positive.
|