Consultor Eletrônico



Kbase 20077: How to call UNIX libm Function: Sin (Sine)
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   01/07/2009
Status: Unverified

GOAL:

How to call UNIX libm Function: Sin (Sine)

FACT(s) (Environment):

Progress 9.x
UNIX

FIX:

The following sample code shows how to call the UNIX LIBM trigonometric function called Sin that resides in the UNIX shared library /usr/lib/libm.1, or /usr/lib/libm.so. This function returns the sine of an angle in radians.

The sample code:

DEFINE VARIABLE decResult AS DECIMAL NO-UNDO.

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

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