38h FN$ATAN calculate arctangent
Input Floating-point argument on the stack.
Output Floating-point result on the stack.
Description

Returns the arctangent in radians of the floating-point number on the run-time stack. The stack pointer (RTA_SP) remains unchanged.

See also: technical manual > utility system services > floating point numbers

Example The following subroutine will return the arctan of 0.5 in FN_RESULT.
        LDD     RTA_SP:
        SUBD    #8              ;make room for argument on stack
        STD     RTA_SP:         ;D now has destination for UT$CPYB
        LDX     #8              ;length for copying argument
        STX     UTW_S0:
        LDX     #FN_ARG         ;source address for UT$CPYB
        OS      UT$CPYB         ;copy argument to stack
        OS      FN$ATAN
        LDX     RTA_SP:         ;source address for copying result
        LDD     #8
        STD     UTW_S0:         ;length for copying result
        ADDD    RTA_SP:         ;add 8 to stack pointer
        STD     RTA_SP:         ;restore stack pointer
        LDD     #FN_RESULT      ;destination for copy
        OS      UT$CPYB
        RTS

    FN_ARG:
        DB      0,0,0,0,0,50h,-1,0

    FN_RESULT:
        DS      8
FN_RESULT will now contain the floating-point result 0.463647609001.
Errors 253 - exponent overflow