next up previous contents
Next: NUM_ Type Conversion Functions
Up: THE NUM_ FUNCTIONS
Previous: Applicability & Efficiency

NUM_ Arithmetic and Mathematical Functions

Arithmetic and mathematical operations may be performed on numbers stored using any numerical data type by invoking appropriate NUM_ functions, using statements such as:

  RESULT = NUM_$<$FUNC$><$T$>$( ARG )
or RESULT = NUM_$<$FUNC$><$T$>$( ARG1, ARG2 )

Here, the NUM_ function takes an argument (or arguments) of type $<$T$>$ and returns a result which is also of type $<$T$>$, having performed the arithmetic or mathematical operation specified by $<$FUNC$>$. The data type code $<$T$>$ may be any of those specified in Table [*] and $<$FUNC$>$ may be any of the function codes specified in Tables [*] & [*]. The number of function arguments (1 or 2) appropriate to each function is also indicated in these latter Tables.

Thus, for example, the function NUM_ADDUW adds two unsigned word arguments to produce an unsigned word result, while NUM_SQRTD evaluates the square root of a double precision argument, returning a double precision result.


next up previous contents
Next: NUM_ Type Conversion Functions
Up: THE NUM_ FUNCTIONS
Previous: Applicability & Efficiency

PRIMDAT --- Processing of Primitive Numerical Data
Starlink User Note 39
R F Warren-Smith
28 February 1995
E-mail:ussc@star.rl.ac.uk

Copyright © 2009 Science and Technology Facilities Council