hb_mathSetHandler()

hb_mathSetHandler()

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)

Compliance

NA

Files

Header file is hbmath.h
Library is core

Platforms

All

hb_mathSetErrMode()

hb_mathSetErrMode()

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

Compliance

NA

Files

Header file is hbmath.h
Library is core

Platforms

All

Seealso

hb_mathGetErrMode()

hb_mathGetLastError()

hb_mathGetLastError()

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:

           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

<iMathErrorType>

Compliance

NA

Files

Header file is hbmath.h
Library is core

Platforms

All

hb_mathGetHandler()

hb_mathGetHandler()

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

<handerproc>

Files

Header file is hbmath.h
Library is core

Platforms

All

hb_mathErMode()

HB_MATHERMODE()

Set/Get math error handling mode

Syntax

      HB_MATHERMODE( [<nNewMode>] ) --> <nOldMode>

Arguments

[<nNumber>] 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

<nOldMode> old math error handling mode

Platforms

All

Files

Header file is hbmath.ch Library is rtl

Exp()

EXP()

Calculates the value of e raised to the passed power.

Syntax

      EXP( <nNumber> ) --> <nValue>

Arguments

<nNumber> Any real number.

Returns

<nValue> The anti-logarithm of <nNumber>

Description

This function returns the value of e raised to the power of <nNumber>. It is the inverse of LOG().

Examples

      ? EXP(45)

Compliance

Clipper

Platforms

All

Files

Library is rtl

Seealso

LOG()