Consultor Eletrônico



Kbase 20078: How to Call UNIX libm Function: Tan (Tangent)
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   7/1/2009
Status: Unverified

GOAL:

How to Call UNIX libm Function: Tan (Tangent)

FACT(s) (Environment):

Progress 9.x
UNIX

FIX:

The following sample code shows how to call the UNIX LIBM trigonometric function called Tan which resides in the UNIX shared library /usr/lib/libm.1, or /usr/lib/libm.so

/*This function returns the tangent of an angle in radians.*/

DEFINE VARIABLE decResult AS DECIMAL NO-UNDO.

PROCEDURE tan 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 tan (INPUT 0.655, OUTPUT decResult).

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