basic math C++ functions and classes More...
#include "c_basic_math.h"Go to the source code of this file.
Functions | |
| void | printBMStatus (const BM_STATUS bms, FILE *file=(FILE *) 0) |
| prints a basic math status (BM_STATUS) to file | |
| bool | isValidValue (const double *value, BM_STATUS *bms=(BM_STATUS *) 0) |
| tests for a valid 64 bit floating point value (double) | |
| bool | isValidValue (const __int64 *value, BM_STATUS *bms=(BM_STATUS *) 0) |
| tests for a valid 64 bit integer (__int64) | |
| double | x_add_y (const double augend, const double addend, BM_STATUS *bms=NULL) |
| safe addition | |
| __int64 | x_add_y (const __int64 augend, const __int64 addend, BM_STATUS *bms=NULL) |
| safe addition | |
| double | x_sub_y (const double minuend, const double subtrahend, BM_STATUS *bms=NULL) |
| safe subtraction | |
| __int64 | x_sub_y (const __int64 minuend, const __int64 subtrahend, BM_STATUS *bms=NULL) |
| safe subtraction | |
| double | x_mul_y (const double multiplier, const double multiplicand, BM_STATUS *bms=NULL) |
| safe multiplication | |
| __int64 | x_mul_y (const __int64 multiplier, const __int64 multiplicand, BM_STATUS *bms=NULL) |
| safe multiplication | |
| double | x_div_y (const double numerator, const double denominator, BM_STATUS *bms=NULL) |
| safe division | |
| __int64 | x_div_y (const __int64 numerator, const __int64 denominator, BM_STATUS *bms=NULL) |
| safe division | |
| double | x_mod_y (const double numerator, const double denominator, BM_STATUS *bms=NULL) |
| safe modulo | |
| __int64 | x_mod_y (const __int64 numerator, const __int64 denominator, BM_STATUS *bms=NULL) |
| safe modulo | |
| double | reciproc_x (const double value, BM_STATUS *bms=NULL) |
| safe reciproc (1/x) | |
| double | Ceil (const double value, BM_STATUS *bms=(BM_STATUS *) 0) |
| Calculates the ceiling of value. | |
| double | Floor (const double value, BM_STATUS *bms=(BM_STATUS *) 0) |
| Calculates the floor of value. | |
| __int64 | toInt64 (const double value, double *intDbl=(double *) 0, BM_STATUS *bms=(BM_STATUS *) 0) |
| strips the decimal places from value and returns the integer (__int64) | |
| double | toDouble (const __int64 value) |
| converts value to a value in double format | |
| double | Round (const double value, const int decPlaces=0, BM_STATUS *bms=(BM_STATUS *) 0) |
| rounds value to a specified number of decimal places | |
| int | Compare (const double value1, const double value2, const double diff=NANO, BM_STATUS *bms=(BM_STATUS *) 0) |
| compares value1 with value2 | |
| int | Compare (const __int64 value1, const __int64 value2, const __int64 diff=0) |
| compares value1 with value2 | |
| int | isEven (const __int64 value) |
| returns 1 if value is even (.. -4, -2, 0, +2, +4, ..) | |
| double | Positive (const double value, BM_STATUS *bms=(BM_STATUS *) 0) |
| calculates the absolute value of value | |
| __int64 | Positive (const __int64 value, BM_STATUS *bms=(BM_STATUS *) 0) |
| calculates the absolute value of value | |
| double | Negative (const double value, BM_STATUS *bms=(BM_STATUS *) 0) |
| calculates the negative absolute value of value | |
| __int64 | Negative (const __int64 value, BM_STATUS *bms=(BM_STATUS *) 0) |
| calculates the negative absolute value of value | |
| double | InvertSign (const double value, BM_STATUS *bms=(BM_STATUS *) 0) |
| inverts the sign of value | |
| __int64 | InvertSign (const __int64 value, BM_STATUS *bms=(BM_STATUS *) 0) |
| inverts the sign of value | |
| double | x_pow_2 (const double base, BM_STATUS *bms=NULL) |
| safe square (power 2) | |
| __int64 | x_pow_2 (const __int64 base, BM_STATUS *bms=NULL) |
| safe square (power 2) | |
| double | x_pow_3 (const double base, BM_STATUS *bms=NULL) |
| safe cube (power 3) | |
| __int64 | x_pow_3 (const __int64 base, BM_STATUS *bms=NULL) |
| safe cube (power 3) | |
| double | x_pow_4 (const double base, BM_STATUS *bms=NULL) |
| safe power 4 | |
| __int64 | x_pow_4 (const __int64 base, BM_STATUS *bms=NULL) |
| safe power 4 | |
| double | x_pow_y (const double base, const double exponent, BM_STATUS *bms=(BM_STATUS *) 0) |
| safe power, calculates base pow exponent | |
| __int64 | x_pow_y (const __int64 base, const __int64 exponent, BM_STATUS *bms=(BM_STATUS *) 0) |
| safe power, calculates base pow exponent | |
| double | x_root_2 (const double radicand, BM_STATUS *bms=(BM_STATUS *) 0) |
| safe square root | |
| __int64 | x_root_2 (const __int64 radicand, BM_STATUS *bms=(BM_STATUS *) 0) |
| safe square root | |
| double | x_root_3 (const double radicand, BM_STATUS *bms=(BM_STATUS *) 0) |
| safe cube root | |
| double | x_root_4 (const double radicand, BM_STATUS *bms=(BM_STATUS *) 0) |
| safe 4th root | |
| double | x_root_y (const double radicand, const double rootExponent, BM_STATUS *bms=(BM_STATUS *) 0) |
| safe exp-th root | |
| __int64 | x_root_y (const __int64 radicand, const __int64 rootExponent, BM_STATUS *bms=(BM_STATUS *) 0) |
| safe exp-th root | |
| double | log_b_x (const double base, const double value, BM_STATUS *bms=(BM_STATUS *) 0) |
| returns the base-logarithm of value | |
| __int64 | log_b_x (const __int64 base, const __int64 value, BM_STATUS *bms=(BM_STATUS *) 0) |
| returns the base-logarithm of value | |
| void | sortAscendant (double *values, const unsigned long count, BM_STATUS *bms=(BM_STATUS *) 0) |
| sorts an array of values in ascendant order | |
| void | sortAscendant (__int64 *values, const unsigned long count, BM_STATUS *bms=(BM_STATUS *) 0) |
| sorts an array of values in ascendant order | |
| long | solveP1norm (double *xr, const double *pf) |
| solves the normalized polynom function of first degree | |
| long | solveP1 (double *xr, const double *pf) |
| solves the polynom function of first degree | |
| long | solveP2norm (double *xr, const double *pf) |
| solves the normalized polynom function of second degree | |
| long | solveP2 (double *xr, const double *pf) |
| solves the polynom function of second degree | |
| long | solveP3norm (double *xr, const double *pf) |
| solves the normalized polynom function of third degree | |
| long | solveP3 (double *xr, const double *pf) |
| solves the polynom function of third degree | |
| long | solveP4norm (double *xr, const double *pf) |
| solves the normalized polynom function of fourth degree | |
| long | solveP4 (double *xr, const double *pf) |
| solves the polynom function of fourth degree | |
| long | getPolyFactors1 (double *pf, const double *xz) |
| calculates the polynom factors of the given zero condition(s) | |
| BM_STATUS | getPolyFactors2 (double *pf, const double *xz) |
| calculates the polynom factors of the given zero condition(s) | |
| BM_STATUS | getPolyFactors3 (double *pf, const double *xz) |
| calculates the polynom factors of the given zero condition(s) | |
| BM_STATUS | getPolyFactors4 (double *pf, const double *xz) |
| calculates the polynom factors of the given zero condition(s) | |
| double | deg2Rad (const double degree, BM_STATUS *bms=(BM_STATUS *) 0) |
| converts degree into radian | |
| double | rad2Deg (const double radian, BM_STATUS *bms=(BM_STATUS *) 0) |
| converts radian into degree | |
| double | stringToDbl (const char *stringValue, BM_STATUS *bms=(BM_STATUS *) 0) |
| converts stringValue into double | |
| __int64 | stringToInt64 (const char *stringValue, char **stopChar=(char **) 0, BM_STATUS *bms=(BM_STATUS *) 0) |
| converts stringValue into __int64 | |
| double | strToDbl (const char *str, BM_STATUS *bms=NULL) |
| converts a null terminated string into a 80 bit floating point value (double) | |
| BM_STATUS | solveL1 (double *xr, const double *lf) |
| solves the linear equation with 1 unknown value | |
| BM_STATUS | solveL2 (double *xr, double *lf[2]) |
| solves the linear equations with 2 unknown values | |
| void | printBitpattern (double value, FILE *file=(FILE *) 0) |
| prints the bitpattern of a double value in hex format | |
| void | printBitpatternFormatted (double value, FILE *file=(FILE *) 0) |
| prints the formatted bitpattern of a double value (sign mantisse exponent) | |
| double | sinus (const double rad, BM_STATUS *bms=(BM_STATUS *) 0) |
| calculates the sinus of rad (value in rad) | |
| double | arcSin (const double value, BM_STATUS *bms=(BM_STATUS *) 0) |
| calculates the arcus sinus of value [-1 .. +1] | |
| double | cosinus (const double rad, BM_STATUS *bms=(BM_STATUS *) 0) |
| calculates the cosinus of rad (value in rad) | |
| double | arcCos (const double value, BM_STATUS *bms=(BM_STATUS *) 0) |
| calculates the arcus cosinus of value [-1 .. +1] | |
| double | tangent (const double rad, BM_STATUS *bms=(BM_STATUS *) 0) |
| calculates the tangent of rad | |
| double | arcTan (const double value, BM_STATUS *bms=(BM_STATUS *) 0) |
| calculates the arcus tangent of value | |
| double | cotangent (const double rad, BM_STATUS *bms=(BM_STATUS *) 0) |
| calculates the cotangent of rad | |
| double | arcCot (const double value, BM_STATUS *bms=(BM_STATUS *) 0) |
| calculates the arcus cotangent of value | |
| int | Find (const double *element1, const unsigned int maxElements, const double elem) |
| looks for a same element in the array | |
| int | Find (const __int64 *element1, const unsigned int maxElements, const __int64 elem) |
| looks for a same element in the array | |
basic math C++ functions and classes
This file contains all C++ functions and classes for safe numerical mathematical operations
This is the C++ wrapper for c_basic_math.h
calculates the arcus cosinus of value [-1 .. +1]
result = acos( value )
| value | [-1 .. +1] | |
| bms | pointer to basic math status to receive error informations |
calculates the arcus cotangent of value
result = acot( value );
calculates the arcus sinus of value [-1 .. +1]
result = asin( value )
| value | [-1 .. +1] | |
| bms | pointer to basic math status to receive error informations |
calculates the arcus tangent of value
result = atan( value )
| value | [-numType_MAX .. +numType_MAX] | |
| bms | pointer to basic math status to receive error informations |
Calculates the ceiling of value.
Calculates the smallest integer that is greater than or equal to value before calling this method
| int Compare | ( | const __int64 | value1, | |
| const __int64 | value2, | |||
| const __int64 | diff = 0 | |||
| ) |
compares value1 with value2
| value1 | the first value compared with value2 | |
| value2 | the second value to be compared with value1 | |
| diff | difference to detect value1 != value2 |
| int Compare | ( | const double | value1, | |
| const double | value2, | |||
| const double | diff = NANO, |
|||
| BM_STATUS * | bms = (BM_STATUS*)0 | |||
| ) |
compares value1 with value2
| value1 | the 64 bit floating point value | |
| value2 | the second value to be compared with value1 | |
| diff | difference to detect value1 != value2 | |
| bms | [out,opt] A pointer to receive basic math status informations (can be null). bms remains unchanged if there is no error in this operation. bms acts accumulative. |
calculates the cosinus of rad (value in rad)
result = cos( rad )
| rad | the angle [-numType_MAX .. +numType_MAX] | |
| bms | pointer to basic math status to receive error informations |
calculates the cotangent of rad
result = cos( rad ) / sin( rad ) = 1 / tan( rad )
converts degree into radian
rad = (degree / 180) * pi
| degree | [in] the degree value | |
| bms | [out,opt] A pointer to receive basic math status informations (can be null). bms remains unchanged if there is no error in this operation. bms acts accumulative. |
| int Find | ( | const __int64 * | element1, | |
| const unsigned int | maxElements, | |||
| const __int64 | elem | |||
| ) |
looks for a same element in the array
and returns the zero based index into the array if an equal element is found
| element1 | pointer to the element in the array where to start | |
| maxElements | number of relevant elements in the array beginning at start (element1) | |
| elem | the element to be searched for |
| int Find | ( | const double * | element1, | |
| const unsigned int | maxElements, | |||
| const double | elem | |||
| ) |
looks for a same element in the array
and returns the zero based index into the array if an equal element is found
| element1 | pointer to the element in the array where to start | |
| maxElements | number of relevant elements in the array beginning at start (element1) | |
| elem | the element to be searched for |
Calculates the floor of value.
Calculates the largest integer that is less than or equal to value
| long getPolyFactors1 | ( | double * | pf, | |
| const double * | xz | |||
| ) |
calculates the polynom factors of the given zero condition(s)
solves (x - xz[0]) = 0 -->> pf[0] = -xz[0]
| pf | [out] result for the polynom factor(s) pf[0] = offset | |
| xz | [in] zero condition(s) for the polynom |
| BM_STATUS getPolyFactors2 | ( | double * | pf, | |
| const double * | xz | |||
| ) |
calculates the polynom factors of the given zero condition(s)
solves (x - xz[1])*(x - xz[0]) = 0 -->> pf[0,1]
| pf | [out] result for the polynom factor(s) pf[0] = offset pf[1] = x-factor | |
| xz | [in] zero condition(s) for the polynom |
| BM_STATUS getPolyFactors3 | ( | double * | pf, | |
| const double * | xz | |||
| ) |
calculates the polynom factors of the given zero condition(s)
solves (x - xz[2])*(x - xz[1])*(x - xz[0]) = 0 -->> pf[0,1,2]
| pf | [out] result for the polynom factor(s) pf[0] = offset pf[1] = x-factor pf[2] = x^2-factor | |
| xz | [in] zero condition(s) for the polynom |
| BM_STATUS getPolyFactors4 | ( | double * | pf, | |
| const double * | xz | |||
| ) |
calculates the polynom factors of the given zero condition(s)
solves (x - xz[3])*(x - xz[2])*(x - xz[1])*(x - xz[0]) = 0 -->> pf[0,1,2,3]
| pf | [out] result for the polynom factor(s) pf[0] = offset pf[1] = x-factor pf[2] = x^2-factor pf[3] = x^3-factor | |
| xz | [in] zero condition(s) for the polynom |
inverts the sign of value
result = -value
inverts the sign of value
result = -value
| int isEven | ( | const __int64 | value | ) |
returns 1 if value is even (.. -4, -2, 0, +2, +4, ..)
| value | [in] the value to be checked |
tests for a valid 64 bit integer (__int64)
| value | a pointer to value to be tested | |
| bms | [out,opt] A pointer to receive basic math status informations (can be null). bms remains unchanged if there is no error in this operation. bms acts accumulative. |
tests for a valid 64 bit floating point value (double)
| value | a pointer to the double value to be tested | |
| bms | [out,opt] A pointer to receive basic math status informations (can be null). bms remains unchanged if there is no error in this operation. bms acts accumulative. |
returns the base-logarithm of value
the log-function solves the equation
base pow result = value
and returns result in double format
| base | the base of the logarithm (useful >= 2) | |
| value | the logarithm's result | |
| bms | [out,opt] A pointer to receive basic math status informations (can be null). bms remains unchanged if there is no error in this operation. bms acts accumulative. |
returns the base-logarithm of value
the log-function solves the equation
base pow result = value
and returns result in double format
| base | the base of the logarithm (useful >= 2) | |
| value | the logarithm's result | |
| bms | [out,opt] A pointer to receive basic math status informations (can be null). bms remains unchanged if there is no error in this operation. bms acts accumulative. |
calculates the negative absolute value of value
result = - abs( value )
calculates the negative absolute value of value
result = -fabs( value )
calculates the absolute value of value
result = abs( value )
calculates the absolute value of value
result = fabs( value )
| void printBitpattern | ( | double | value, | |
| FILE * | file = (FILE*)0 | |||
| ) |
prints the bitpattern of a double value in hex format
| value | the value to be printed | |
| file | pointer to a open FILE with write access. If file=0 (default) this function prints to stdout. If file is a valid pointer this function prints to file. |
| void printBitpatternFormatted | ( | double | value, | |
| FILE * | file = (FILE*)0 | |||
| ) |
prints the formatted bitpattern of a double value (sign mantisse exponent)
| value | the value to be printed | |
| file | pointer to a open FILE with write access. If file=0 (default) this function prints to stdout. If file is a valid pointer this function prints to file. |
| void printBMStatus | ( | const BM_STATUS | bms, | |
| FILE * | file = (FILE*)0 | |||
| ) |
prints a basic math status (BM_STATUS) to file
| bms | basic math status to be printed | |
| file | pointer to a open FILE with write access. If file=0 (default) this function prints to stdout. If file is a valid pointer this function prints to file. |
converts radian into degree
degree = (rad / pi) * 180
| radian | [in] the radian value | |
| bms | [out,opt] A pointer to receive basic math status informations (can be null). bms remains unchanged if there is no error in this operation. bms acts accumulative. |
| double reciproc_x | ( | const double | value, | |
| BM_STATUS * | bms = NULL | |||
| ) |
safe reciproc (1/x)
returns the result of 1 / x
| value | [in] the value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
rounds value to a specified number of decimal places
decPlaces can be negative
| value | [in] the value to be rounded | |
| decPlaces | [in] Positive number indicates how many places to the right of the decimal are included in the rounding. If omitted (decPlaces=0), assignRound() rounds to integer. Negative number indicates how many places to the left of the decimal are included in the rounding. | |
| bms | [out,opt] A pointer to receive basic math status informations (can be null). bms remains unchanged if there is no error in this operation. bms acts accumulative. |
calculates the sinus of rad (value in rad)
result = sin( rad )
| rad | the angle [-numType_MAX .. +numType_MAX] | |
| bms | pointer to basic math status to receive error informations |
| BM_STATUS solveL1 | ( | double * | xr, | |
| const double * | lf | |||
| ) |
solves the linear equation with 1 unknown value
equation lf[1] * xr[0] - lf[0] = 0 will be solved for xr[0] = lf[0] / lf[1]
| xr | [out] the result(s) of the linear equation(s) | |
| lf | [in] the linear factors of the equation |
| BM_STATUS solveL2 | ( | double * | xr, | |
| double * | lf[2] | |||
| ) |
solves the linear equations with 2 unknown values
equation 1: lf[0][2] * b + lf[0][1] * a = lf[0][0]
equation 1: lf[1][2] * b + lf[1][1] * a = lf[1][0]
-->> xr[0] = result for a
-->> xr[1] = result for b
| xr | [out] the result(s) of the linear equation(s) | |
| lf | [in] the linear factors of the equation |
| long solveP1 | ( | double * | xr, | |
| const double * | pf | |||
| ) |
solves the polynom function of first degree
solves pf[1]*x + pf[0] = 0 -->> xr[0] = -pf[0] / pf[1]
| xr | [out] pointer to store the solution(s) | |
| pf | [in] polynom factor(s) |
| long solveP1norm | ( | double * | xr, | |
| const double * | pf | |||
| ) |
solves the normalized polynom function of first degree
solves x + pf[0] = 0 -->> xr[0] = -pf[0]
| xr | [out] pointer to store the solution(s) | |
| pf | [in] polynom factor(s) |
| long solveP2 | ( | double * | xr, | |
| const double * | pf | |||
| ) |
solves the polynom function of second degree
solves pf[2]*x^2 + pf[1]*x + pf[0] = 0 -->> xr[0,1]
| xr | [out] pointer to store the solution(s) the solution values are stored in ascendant order | |
| pf | [in] polynom factor(s) |
| long solveP2norm | ( | double * | xr, | |
| const double * | pf | |||
| ) |
solves the normalized polynom function of second degree
solves x^2 + pf[1]*x + pf[0] = 0 -->> xr[0,1]
| xr | [out] pointer to store the solution(s) the solution values are stored in ascendant order | |
| pf | [in] polynom factor(s) |
| long solveP3 | ( | double * | xr, | |
| const double * | pf | |||
| ) |
solves the polynom function of third degree
solves pf[3]*x^3 + pf[2]*x^2 + pf[1]*x + pf[0] = 0 -->> xr[0,1,2]
| xr | [out] pointer to store the solution(s) the solution values are stored in ascendant order | |
| pf | [in] polynom factor(s) |
| long solveP3norm | ( | double * | xr, | |
| const double * | pf | |||
| ) |
solves the normalized polynom function of third degree
solves x^3 + pf[2]*x^2 + pf[1]*x + pf[0] = 0 -->> xr[0,1,2]
| xr | [out] pointer to store the solution(s) the solution values are stored in ascendant order | |
| pf | [in] polynom factor(s) |
| long solveP4 | ( | double * | xr, | |
| const double * | pf | |||
| ) |
solves the polynom function of fourth degree
solves pf[4]*x^4 + pf[3]*x^3 + pf[2]*x^2 + pf[1]*x + pf[0] = 0 -->> xr[0,1,2,3]
| xr | [out] pointer to store the solution(s) the solution values are stored in ascendant order | |
| pf | [in] polynom factor(s) |
| long solveP4norm | ( | double * | xr, | |
| const double * | pf | |||
| ) |
solves the normalized polynom function of fourth degree
solves x^4 + pf[3]*x^3 + pf[2]*x^2 + pf[1]*x + pf[0] = 0 -->> xr[0,1,2,3]
| xr | [out] pointer to store the solution(s) the solution values are stored in ascendant order | |
| pf | [in] polynom factor(s) |
sorts an array of values in ascendant order
| values | [in,out] the values to be sorted returns the sorted values in the same array | |
| count | [in] number of values in values | |
| bms | [out,opt] A pointer to receive basic math status informations (can be null). bms remains unchanged if there is no error in this operation. bms acts accumulative. |
sorts an array of values in ascendant order
| values | [in,out] the values to be sorted returns the sorted values in the same array | |
| count | [in] number of values in values | |
| bms | [out,opt] A pointer to receive basic math status informations (can be null). bms remains unchanged if there is no error in this operation. bms acts accumulative. |
converts stringValue into double
| stringValue | pointer to the first character in the string where the value begins | |
| bms | (can be 0) pointer to basic math status (see BM_STATUS) to get error informations |
| __int64 stringToInt64 | ( | const char * | stringValue, | |
| char ** | stopChar = (char**)0, |
|||
| BM_STATUS * | bms = (BM_STATUS*)0 | |||
| ) |
converts stringValue into __int64
| stringValue | pointer to the first character in the string where the value begins | |
| stopChar | [out,opt] (can be null) pointer into stringValue where the scanner stopped | |
| bms | [out,opt] A pointer to receive basic math status informations (can be null). bms remains unchanged if there is no error in this operation. bms acts accumulative. |
| double strToDbl | ( | const char * | str, | |
| BM_STATUS * | bms = NULL | |||
| ) |
converts a null terminated string into a 80 bit floating point value (double)
returns the value represented by the string
| str | [in] the zero terminated string fpvalue ::= {whitespace}[sign]value[echar[sign]integer] whitespace ::= ' ' | '\t' | '\n' | '\r' //blank or tabulator or linefeed or carriage return sign ::= '+' | '-' //plus or minus seperator ::= ',' | '_' //comma or underline digit ::= '0' ... '9' //a value in the range 0..9 integer ::= digit {digit} //integer has at least one digit int_sep ::= digit {[seperator]digit} //integer begins and ends always //with a digit, not with a seperator value ::= (integer) | (integer'.') | (integer'.'integer) | ('.'integer) echar ::= 'd' | 'D' | 'e' | 'E' //one of these characters indicates the //power to base 10 | |
| bms | [out,opt] basic math status pointer to receive status information bms remains unchanged, if there is no error in this function (bms acts accumulative) |
calculates the tangent of rad
result = tan( rad )
| rad | the angle [-numType_MAX .. +numType_MAX] | |
| bms | pointer to basic math status to receive error informations |
| double toDouble | ( | const __int64 | value | ) |
converts value to a value in double format
| value | [in] the value which will be converted to double |
| __int64 toInt64 | ( | const double | value, | |
| double * | intDbl = (double*)0, |
|||
| BM_STATUS * | bms = (BM_STATUS*)0 | |||
| ) |
strips the decimal places from value and returns the integer (__int64)
Extracts the integer part from value
| __int64 x_add_y | ( | const __int64 | augend, | |
| const __int64 | addend, | |||
| BM_STATUS * | bms = NULL | |||
| ) |
safe addition
adds addend to augend and returns the result of this operation
| augend | [in] the first value for this operation | |
| addend | [in] the second value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
| double x_add_y | ( | const double | augend, | |
| const double | addend, | |||
| BM_STATUS * | bms = NULL | |||
| ) |
safe addition
adds addend to augend and returns the result of this operation
| augend | [in] the first value for this operation | |
| addend | [in] the second value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
| __int64 x_div_y | ( | const __int64 | numerator, | |
| const __int64 | denominator, | |||
| BM_STATUS * | bms = NULL | |||
| ) |
safe division
divides numerator with denominator and returns the result of this operation
| numerator | [in] the first value for this operation | |
| denominator | [in] the second value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
| double x_div_y | ( | const double | numerator, | |
| const double | denominator, | |||
| BM_STATUS * | bms = NULL | |||
| ) |
safe division
divides numerator with denominator and returns the result of this operation
| numerator | [in] the first value for this operation | |
| denominator | [in] the second value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
| __int64 x_mod_y | ( | const __int64 | numerator, | |
| const __int64 | denominator, | |||
| BM_STATUS * | bms = NULL | |||
| ) |
safe modulo
divides numerator with denominator and returns the remainder as result of this operation
| numerator | [in] the first value for this operation | |
| denominator | [in] the second value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
| double x_mod_y | ( | const double | numerator, | |
| const double | denominator, | |||
| BM_STATUS * | bms = NULL | |||
| ) |
safe modulo
divides numerator with denominator and returns the remainder as result of this operation
| numerator | [in] the first value for this operation | |
| denominator | [in] the second value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
| __int64 x_mul_y | ( | const __int64 | multiplier, | |
| const __int64 | multiplicand, | |||
| BM_STATUS * | bms = NULL | |||
| ) |
safe multiplication
multiplies multiplier with multiplicand and returns the result of this operation
| multiplier | [in] the first value for this operation | |
| multiplicand | [in] the second value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
| double x_mul_y | ( | const double | multiplier, | |
| const double | multiplicand, | |||
| BM_STATUS * | bms = NULL | |||
| ) |
safe multiplication
multiplies multiplier with multiplicand and returns the result of this operation
| multiplier | [in] the first value for this operation | |
| multiplicand | [in] the second value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
| __int64 x_pow_2 | ( | const __int64 | base, | |
| BM_STATUS * | bms = NULL | |||
| ) |
safe square (power 2)
calculates base raised to the power of 2 and returns the result of this operation
| base | [in] the base value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
| double x_pow_2 | ( | const double | base, | |
| BM_STATUS * | bms = NULL | |||
| ) |
safe square (power 2)
calculates base raised to the power of 2 and returns the result of this operation
| base | [in] the base value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
| __int64 x_pow_3 | ( | const __int64 | base, | |
| BM_STATUS * | bms = NULL | |||
| ) |
safe cube (power 3)
calculates base raised to the power of 3 and returns the result of this operation
| base | [in] the base value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
| double x_pow_3 | ( | const double | base, | |
| BM_STATUS * | bms = NULL | |||
| ) |
safe cube (power 3)
calculates base raised to the power of 3 and returns the result of this operation
| base | [in] the base value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
| __int64 x_pow_4 | ( | const __int64 | base, | |
| BM_STATUS * | bms = NULL | |||
| ) |
safe power 4
calculates base raised to the power of 4 and returns the result of this operation
| base | [in] the base value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
| double x_pow_4 | ( | const double | base, | |
| BM_STATUS * | bms = NULL | |||
| ) |
safe power 4
calculates base raised to the power of 4 and returns the result of this operation
| base | [in] the base value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
safe power, calculates base pow exponent
calculates base raised to the power of exponent and returns the result of this operation
| base | [in] the base value for this operation | |
| exponent | [in] the exponent value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
safe power, calculates base pow exponent
calculates base raised to the power of exponent and returns the result of this operation
| base | [in] the base value for this operation | |
| exponent | [in] the exponent value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
safe square root
calculates the square root of radicand and returns the result of this operation
| radicand | [in] the value for this operation | |
| bms | [out,opt] A pointer to receive basic math status informations (can be null). bms remains unchanged if there is no error in this operation. bms acts accumulative. |
safe square root
calculates the square root of radicand and returns the result of this operation
| radicand | [in] the value for this operation | |
| bms | [out,opt] a pointer to store error informations like overflow status remains unchanged, if there is no error in this calculation (status acts accumulative) |
safe cube root
calculates the cube root of radicand and returns the result of this operation
| radicand | [in] the value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
safe 4th root
calculates the 4th root of radicand and returns the result of this operation
| radicand | [in] the value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
| __int64 x_root_y | ( | const __int64 | radicand, | |
| const __int64 | rootExponent, | |||
| BM_STATUS * | bms = (BM_STATUS*)0 | |||
| ) |
safe exp-th root
calculates the exp-th root of radicand and returns the result of this operation
| radicand | [in] the value for this operation | |
| rootExponent | [in] the exponent of the root | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
| double x_root_y | ( | const double | radicand, | |
| const double | rootExponent, | |||
| BM_STATUS * | bms = (BM_STATUS*)0 | |||
| ) |
safe exp-th root
calculates the exp-th root of radicand and returns the result of this operation
| radicand | [in] the value for this operation | |
| rootExponent | [in] the exponent of the root | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
| __int64 x_sub_y | ( | const __int64 | minuend, | |
| const __int64 | subtrahend, | |||
| BM_STATUS * | bms = NULL | |||
| ) |
safe subtraction
subtracts subtrahend from minuend and returns the result of this operation
| minuend | [in] the first value for this operation | |
| subtrahend | [in] the second value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
| double x_sub_y | ( | const double | minuend, | |
| const double | subtrahend, | |||
| BM_STATUS * | bms = NULL | |||
| ) |
safe subtraction
subtracts subtrahend from minuend and returns the result of this operation
| minuend | [in] the first value for this operation | |
| subtrahend | [in] the second value for this operation | |
| bms | [out,opt] basic math status a pointer to store error informations like overflow bms remains unchanged, if there is no error in this calculation (bms acts accumulative) |
1.6.3