home *** CD-ROM | disk | FTP | other *** search
- ********************
-
- FUNCTION Sin
-
- * Written and contributed by ESSOR MASO
- *
- * For the input argument in the first circle, degrees -360 <=arg <=360.
- *
- * The error ABS(e(arg)) <= 2*10^(-9)
- * The value 2 is returned if either the argument or the D or R is missing,
- * or the ABS(arg) > 360.
- *
- * Correct form: SIN(arg,'D')
- *
- * National Bureau of Standards Handbook of Mathematical Functions
-
- PARAMETERS _sinwork, _sindeg
-
- IF TYPE("_sinwork") + TYPE("_sindeg") != "NC"
- RETURN(2)
- ENDIF
-
- SET DECIMAL TO 10
-
- IF ABS(IF(UPPER(_sindeg)#'D', _sinwork, _sinwork*1.5707963268/90))>6.2831853072 .OR. PCOUNT()#2
- RETURN(2)
- ENDIF
- RETURN(COSIN(IF(_sindeg # 'D',1.5707963268,90) - _sinwork, _sindeg))
-
- * End of File