/* $DOC$ $AUTHOR$ Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ Abs() $CATEGORY$ API $SUBCATEGORY$ Math $ONELINER$ Return the absolute value of a number. $SYNTAX$ Abs( ) --> nAbsNumber $ARGUMENTS$ Any number. $RETURNS$ The absolute numeric value. $DESCRIPTION$ This function yields the absolute value of the numeric value or expression . $EXAMPLES$ LOCAL nNumber := 50 LOCAL nNumber1 := 27 ? nNumber - nNumber1 ? nNumber1 - nNumber ? Abs( nNumber - nNumber1 ) ? Abs( nNumber1 - nNumber ) ? Abs( -1 * 345 ) $STATUS$ R $COMPLIANCE$ C $PLATFORMS$ All $FILES$ Library is core $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ Exp() $CATEGORY$ API $SUBCATEGORY$ Math $ONELINER$ Calculates the value of e raised to the passed power. $SYNTAX$ Exp( ) --> nValue $ARGUMENTS$ Any real number. $RETURNS$ The anti-logarithm of $DESCRIPTION$ This function returns the value of e raised to the power of . It is the inverse of Log(). $EXAMPLES$ ? Exp( 45 ) $STATUS$ R $COMPLIANCE$ C $PLATFORMS$ All $FILES$ Library is core $SEEALSO$ Log() $END$ */ /* $DOC$ $AUTHOR$ Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ Int() $CATEGORY$ API $SUBCATEGORY$ Math $ONELINER$ Return the integer port of a numeric value. $SYNTAX$ Int( ) --> nIntNumber $ARGUMENTS$ Any numeric value. $RETURNS$ The integer portion of the numeric value. $DESCRIPTION$ This function converts a numeric expression to an integer. All decimal digits are truncated. This function does not round a value upward or downward; it merely truncates a number at the decimal point. $EXAMPLES$ Set( _SET_DECIMALS, 5 ) ? Int( 632512.62541 ) ? Int( 845414111.91440 ) $STATUS$ R $COMPLIANCE$ C $PLATFORMS$ All $FILES$ Library is core $SEEALSO$ Round(), StrZero() $END$ */ /* $DOC$ $AUTHOR$ Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ Log() $CATEGORY$ API $SUBCATEGORY$ Math $ONELINER$ Returns the natural logarithm of a number. $SYNTAX$ Log( ) --> nLog $ARGUMENTS$ Any numeric expression. $RETURNS$ The natural logarithm of . $DESCRIPTION$ This function returns the natural logarithm of the number . If is 0 or less than 0, a numeric overflow occurs, which is depicted on the display device as a series of asterisks. This function is the inverse of Exp(). $EXAMPLES$ ? Log( 632512 ) $STATUS$ R $COMPLIANCE$ C $PLATFORMS$ All $FILES$ Library is core $SEEALSO$ Exp() $END$ */ /* $DOC$ $AUTHOR$ Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ Max() $CATEGORY$ API $SUBCATEGORY$ Math $ONELINER$ Returns the maximum of two numbers or dates. $SYNTAX$ Max( , ) --> xMax $ARGUMENTS$ Any date or numeric value. Any date or numeric value (same type as ). $RETURNS$ The larger numeric (or later date) value. $DESCRIPTION$ This function returns the larger of the two passed expressions. If and are numeric data types, the value returned by this function will be a numeric data type as well and will be the larger of the two numbers passed to it. If and are date data types, the return value will be a date data type as well. It will be the later of the two dates passed to it. $EXAMPLES$ ? Max( 214514214, 6251242142 ) ? Max( 0d20001111, 0d20140621 ) $STATUS$ R $COMPLIANCE$ C $PLATFORMS$ All $FILES$ Library is core $SEEALSO$ Min() $END$ */ /* $DOC$ $AUTHOR$ Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ Min() $CATEGORY$ API $SUBCATEGORY$ Math $ONELINER$ Determines the minimum of two numbers or dates. $SYNTAX$ Min( , ) --> xMin $ARGUMENTS$ Any date or numeric value. Any date or numeric value. $RETURNS$ The smaller numeric (or earlier date) value. $DESCRIPTION$ This function returns the smaller of the two passed expressions. and must be the same data type. If numeric, the smaller number is returned. If dates, the earlier date is returned. $EXAMPLES$ ? Min( 214514214, 6251242142 ) ? Min( 0d20001111, 0d20140621 ) $STATUS$ R $COMPLIANCE$ C $PLATFORMS$ All $FILES$ Library is core $SEEALSO$ Max() $END$ */ /* $DOC$ $TEMPLATE$ Function $NAME$ Mod() $CATEGORY$ API $SUBCATEGORY$ Math $ONELINER$ Return the modulus of two numbers. $SYNTAX$ Mod( , ) --> $ARGUMENTS$ Numerator in a divisional expression. Denominator in a divisional expression. $RETURNS$ The remainder after the division operation. $DESCRIPTION$ This function returns the remainder of one number divided by another. $EXAMPLES$ ? Mod( 12, 8.521 ) ? Mod( 12, 0 ) ? Mod( 62412.5142, 4522114.12014 ) $STATUS$ R $COMPLIANCE$ C $PLATFORMS$ All $FILES$ Library is core $SEEALSO$ % $END$ */ /* $DOC$ $AUTHOR$ Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ Sqrt() $CATEGORY$ API $SUBCATEGORY$ Math $ONELINER$ Calculates the square root of a number. $SYNTAX$ Sqrt( ) --> nSqrt $ARGUMENTS$ Any numeric value. $RETURNS$ The square root of . $DESCRIPTION$ This function returns the square root of . The precision of this evaluation is based solely on the setting of `_SET_DECIMALS`. Any negative number passed as will always return a 0. $EXAMPLES$ Set( _SET_DECIMALS, 5 ) ? Sqrt( 632512.62541 ) ? Sqrt( 845414111.91440 ) $STATUS$ R $COMPLIANCE$ C $PLATFORMS$ All $FILES$ Library is core $SEEALSO$ Round() $END$ */ /* $DOC$ $AUTHOR$ Copyright 2000 Luiz Rafael Culik $TEMPLATE$ Function $NAME$ Round() $CATEGORY$ API $SUBCATEGORY$ Math $ONELINER$ Rounds off a numeric expression. $SYNTAX$ Round( , ) --> nResult $ARGUMENTS$ Any numeric value. The number of places to round to. $RETURNS$ The rounded number. $DESCRIPTION$ This function rounds off the value of to the number of decimal places specified by . If the value of is a negative number, the function will attempt to round in whole numbers. Numbers from 5 through 9 will be rounded up, all others will be rounded down. $EXAMPLES$ ? Round( 632512.62541, 5 ) ? Round( 845414111.91440, 3 ) $STATUS$ R $COMPLIANCE$ C $PLATFORMS$ All $FILES$ Library is core $SEEALSO$ Int(), Str(), Val(), SET FIXED $END$ */ /* $DOC$ $AUTHOR$ Copyright 2001 IntTec GmbH, Martin Vogel $TEMPLATE$ C Function $NAME$ hb_mathGetLastError() $CATEGORY$ C level API $SUBCATEGORY$ Math $ONELINER$ get the last math lib error $SYNTAX$ C Prototype #include "hbmath.h" hb_mathGetLastError( HB_MATH_EXCEPTION * phb_exc ) --> int iMathErrorType $ARGUMENTS$ phb_exc pointer to HB_MATH_EXCEPTION structure, if not NULL, the structure will be filled with information about the last math error: ```c typedef struct _HB_MATH_EXCEPTION { int type; // Math error type, is one of the constants // HB_MATH_ERR_xxx defined in hbmath.ch char *funcname; // Pointer to name of the math C RTL routine // that caused the error. char *error; // Pointer to error description. double arg1; // First and double arg2; // Second double argument to the math routine. double retval; // Corrected return value for the math routine. int retvalwidth; // Width and int retvaldec; // Decimals of the corrected return value, // both default to -1 int handled; // 1, if the math error is already corrected, // 0 otherwise. } HB_MATH_EXCEPTION; ``` $RETURNS$ $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ NA $FILES$ Header file is hbmath.h Library is core $PLATFORMS$ All $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2001 IntTec GmbH, Martin Vogel $TEMPLATE$ C Function $NAME$ hb_mathResetError() $CATEGORY$ C level API $SUBCATEGORY$ Math $ONELINER$ Reset the internal math error information structure $SYNTAX$ C Prototype #include "hbmath.h" hb_mathResetError( void ) $ARGUMENTS$ $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ NA $FILES$ Header file is hbmath.h Library is core $PLATFORMS$ All $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2001 IntTec GmbH, Martin Vogel $TEMPLATE$ C Function $NAME$ hb_mathIsMathErr() $CATEGORY$ C level API $SUBCATEGORY$ Math $ONELINER$ Check if Harbour math error handling is available $SYNTAX$ C Prototype #include "hbmath.h" hb_mathIsMathErr( void ) --> int iIsMathHandler $ARGUMENTS$ $RETURNS$ $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ NA $FILES$ Header file is hbmath.h Library is core $PLATFORMS$ All $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2001 IntTec GmbH, Martin Vogel $TEMPLATE$ C Function $NAME$ hb_mathSetHandler() $CATEGORY$ C level API $SUBCATEGORY$ Math $ONELINER$ set the Harbour math handler $SYNTAX$ C Prototype #include "hbmath.h" hb_mathSetHandler( HB_MATH_HANDLERPROC handlerproc ) --> HB_MATH_HANDLERPROC previous_handerproc $ARGUMENTS$ handlerproc custom math handler typedef int (* HB_MATH_HANDLERPROC)(HB_MATH_EXCEPTION * err) $RETURNS$ previous_handlerproc previous math handler typedef int (* HB_MATH_HANDLERPROC)(HB_MATH_EXCEPTION * err) $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ NA $FILES$ Header file is hbmath.h Library is core $PLATFORMS$ All $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2001 IntTec GmbH, Martin Vogel $TEMPLATE$ C Function $NAME$ hb_mathGetHandler() $CATEGORY$ C level API $SUBCATEGORY$ Math $ONELINER$ get current Harbour math error handler $SYNTAX$ C Prototype #include "hbmath.h" hb_mathGetHandler( void ) --> HB_MATH_HANDLERPROC handlerproc $ARGUMENTS$ handlerproc custom math handler typedef int (* HB_MATH_HANDLERPROC)(HB_MATH_EXCEPTION * err) $RETURNS$ $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ NA $FILES$ Header file is hbmath.h Library is core $PLATFORMS$ All $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2001 IntTec GmbH, Martin Vogel $TEMPLATE$ C Function $NAME$ hb_mathSetErrMode() $CATEGORY$ C level API $SUBCATEGORY$ Math $ONELINER$ set math error handling mode $SYNTAX$ C Prototype #include "hbmath.h" hb_mathSetErrMode( int imode ) --> int ioldmode $ARGUMENTS$ imode math error handling mode, one of the following constants, defined in hbmath.ch: HB_MATH_ERRMODE_DEFAULT HB_MATH_ERRMODE_CDEFAULT HB_MATH_ERRMODE_USER HB_MATH_ERRMODE_USERDEFAULT HB_MATH_ERRMODE_USERCDEFAULT $RETURNS$ ioldmode old math error handling mode $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ NA $FILES$ Header file is hbmath.h Library is core $PLATFORMS$ All $SEEALSO$ hb_mathGetErrMode() $END$ */ /* $DOC$ $AUTHOR$ Copyright 2001 IntTec GmbH, Martin Vogel $TEMPLATE$ C Function $NAME$ hb_mathGetErrMode() $CATEGORY$ C level API $SUBCATEGORY$ Math $ONELINER$ get math error handling mode $SYNTAX$ C Prototype #include "hbmath.h" hb_mathGetErrMode( void ) --> imode $ARGUMENTS$ $RETURNS$ imode math error handling mode $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ NA $FILES$ Header file is hbmath.h Library is core $PLATFORMS$ All $SEEALSO$ hb_mathSetErrMode() $END$ */ /* $DOC$ $AUTHOR$ Copyright 2001 IntTec GmbH, Martin Vogel $TEMPLATE$ Function $NAME$ hb_matherMode() $CATEGORY$ API $SUBCATEGORY$ Math $ONELINER$ Set/Get math error handling mode $SYNTAX$ hb_matherMode( [] ) --> nOldMode $ARGUMENTS$ [] new math error handling mode, one of the following constants, defined in hbmath.ch: HB_MATH_ERRMODE_DEFAULT HB_MATH_ERRMODE_CDEFAULT HB_MATH_ERRMODE_USER HB_MATH_ERRMODE_USERDEFAULT HB_MATH_ERRMODE_USERCDEFAULT $RETURNS$ old math error handling mode $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ $PLATFORMS$ All $FILES$ Header file is hbmath.ch Library is core $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2001 IntTec GmbH, Martin Vogel $TEMPLATE$ Function $NAME$ hb_matherBlock() $CATEGORY$ API $SUBCATEGORY$ Math $ONELINER$ Set/Get math error handling codeblock $SYNTAX$ hb_matherBlock( [] ) --> bOldBlock $ARGUMENTS$ $RETURNS$ is the current error handler codeblock $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ $PLATFORMS$ All $FILES$ Library is core $SEEALSO$ $END$ */