Consultor Eletrônico



Kbase 20073: How to Call UNIX libm Function: Cosh (Hyperbolic Cosine)
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   1/28/2005
Solution ID: 20073

GOAL:

How to Call UNIX libm Function: Cosh (Hyperbolic Cosine)

FACT(s) (Environment):

Progress 9.x

FIX:

The following sample code shows how to call the UNIX LIBM trigonometric function called Cosh which resides in the UNIX shared library /usr/lib/libm.1, or /usr/lib/libm.so. This function returns the hyperbolic cosine of a number in radians.

The sample code:

DEFINE VARIABLE decResult AS DECIMAL NO-UNDO.

PROCEDURE cosh EXTERNAL "/usr/lib/libm.1" CDECL:
DEFINE INPUT PARAMETER dblValue AS DOUBLE NO-UNDO.
DEFINE RETURN PARAMETER dblResult AS DOUBLE NO-UNDO.
END PROCEDURE.

RUN cosh (INPUT 0.655, OUTPUT decResult).

MESSAGE "The Hyperbolic Cosine of 0.655 is " decResult
VIEW-AS ALERT-BOX.