## Appendix AICL Functions

Where the type is given as ‘Real or Integer’ the type of the result is the same as the type of the argument.

 Name Type Definition ABS(X) Real or Integer $\mid x\mid$ ASIN(X) Real ${sin}^{-1}x\phantom{\rule{2.77695pt}{0ex}}where-1\le x\le 1$ $-\pi /2\le result\le \pi /2$ ASIND(X) Real ${sin}^{-1}x\phantom{\rule{2.77695pt}{0ex}}where-1\le x\le 1$ $-90\le result\le 90$ ACOS(X) Real ${cos}^{-1}x\phantom{\rule{2.77695pt}{0ex}}where-1\le x\le 1$ $0\le result\le \pi$ ACOSD(X) Real ${cos}^{-1}x\phantom{\rule{2.77695pt}{0ex}}where-1\le x\le 1$ $0\le result\le 180$ ATAN(X) Real ${tan}^{-1}x$ $-\pi /2\le result\le \pi /2$ ATAND(X) Real ${tan}^{-1}x$ $-90\le result\le 90$ ATAN2(X1,X2) Real ${tan}^{-1}\left({x}_{1}/{x}_{2}\right)$ $-\pi according to quadrant in which point (${x}_{2},{x}_{1}$) lies
 Name Type Definition ATAN2D(X1,X2) Real ${tan}^{-1}\left({x}_{1}/{x}_{2}\right)$ $-180 according to quadrant in which point (${x}_{2},{x}_{1}$) lies BIN(I,n,m) String integer I formatted in binary into an n char string with m significant digits CHAR(I) String Character whose ASCII value is I COS(X) Real $cosx$ (x in radians) COSD(X) Real $cosx$ (x in degrees) COSH(X) Real $coshx$ DATE() String The Current Date DEC(I,n,m) String integer I formatted in decimal into an n char string with m significant digits DECL(S) Real A Declination in Radians from a string in degrees, minutes, seconds DEC2S(R,NDP,SEP) String String in DMS from Dec in radians. NDP decimal places on seconds. Character SEP separates fields DIM(X1,X2) Real or Integer Positive difference ${x}_{1}-min\left({x}_{1},{x}_{2}\right)$ ELEMENT(I,DELIM,S) String Ith element of delimited string, I $\ge 0$ EXP(X) Real ${e}^{x}$ FILE_EXISTS(S) Logical TRUE if file S exists FLOAT(I) Real Integer I converted to real GETNBS(S) Any Value of noticeboard item GET_SYMBOL(S) String Get Value of DCL Symbol
 Name Type Definition HEX(I,n,m) String integer I formatted in hexadecimal into an n char string with m significant digits IAND(I1,I2) Integer Bitwise AND of two integers ICHAR(S) Integer ASCII value of first character of String IEOR(I1,I2) Integer Bitwise exclusive OR of two integers IFIX(X) Integer Real to Integer by Truncation Equivalent to INT INDEX(S1,S2) Integer Position of first occurrence of Pattern S2 in string S1 (Zero if not found) INKEY() Integer Key value of last trapped key pressed Only works in screen mode INOT(I) Integer Bitwise Complement of Integer INT(X) Integer Real to Integer by Truncation INTEGER(X) Integer The value of X converted to an integer Equivalent to NINT IOR(I1,I2) Integer Bitwise OR of two integers KEYVAL(S) Integer Value of key with name S LEN(S) Integer Length of String S LGE(S1,S2) Logical True if S1 $\ge$ S2 (ASCII collating sequence) LGT(S1,S2) Logical True if S1 $>$ S2 (ASCII collating sequence) LLE(S1,S2) Logical True if S1 $\le$ S2 (ASCII collating sequence) LLT(S1,S2) Logical True if S1 $<$ S2 (ASCII collating sequence) LOG(X) Real $lnx$
 Name Type Definition LOG10(X) Real ${log}_{10}x$ LOGICAL(X) Logical The value of X converted to logical MAX(X1,X2, ...) Real or Integer Maximum of two or more arguments MIN(X1,X2, ...) Real or Integer Minimum of two or more arguments MOD(X1,X2) Real or Integer ${x}_{1}-int\left({x}_{1}/{x}_{2}\right)×{x}_{2}$ NINT(X) Integer Nearest integer to X OCT(I,n,m) String integer I formatted in octal into an n char string with m significant digits OK(stat) Logical True if VMS Status OK RA(S) Real Right Ascension in Radians from a string in hours, minutes, seconds RA2S(R,NDP,SEP) String String in HMS from RA in radians. NDP decimal places on seconds. Character SEP separates fields RANDOM(I) Real Random number between 0 and 1 from seed I I must be a variable REAL(X) Real The value of X converted to real SIGN(X1,X2) Real or Integer ${x}_{1}$ with sign of ${x}_{2}$ SIN(X) Real $sinx$ (x in radians) SIND(X) Real $sinx$ (x in degrees) SINH(X) Real $sinhx$ SNAME(S,n[,m]) String String formed by concatenating string S with integer n formatted into m characters with leading zeros. If m is omitted, SNAME uses the required number of characters
 Name Type Definition STRING(X) Logical The value of X converted to a string SQRT(X) Real $\sqrt{x}$ SUBSTR(S,n,m) String Substring of S beginning at n ($\ge$ 1) of length m TAN(X) Real $tanx$ (x in radians) TAND(X) Real $tanx$ (x in degrees) TANH(X) Real $tanhx$ TIME() String The current time TYPE(X) String The Type of Variable X ‘REAL’, ‘INTEGER’, ‘LOGICAL’, ‘STRING’ or ‘UNDEFINED’ UNDEFINED(X) Logical TRUE if X is undefined UPCASE(S) String String S converted to Upper case VARIABLE(proc,X) Any Returns value of variable X of procedure proc