Kbase 20075: How to Call UNIX libm Function: Tanh (Hyperbolic Tangent)
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  01/07/2009 |
|
Status: Unverified
GOAL:
How to Call UNIX libm Function: Tanh (Hyperbolic Tangent)
FACT(s) (Environment):
Progress 9.x
UNIX
FIX:
The following sample code shows how to call the UNIX LIBM trigonometric function called Tanh 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 tanh 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 tanh (INPUT 0.655, OUTPUT decResult).
MESSAGE "The Hyperbolic Tangent of 0.655 is " decResult
VIEW-AS ALERT-BOX.