next up previous contents
Next: NUM_ Inter-comparison Functions
Up: THE NUM_ FUNCTIONS
Previous: NUM_ Arithmetic and Mathematical Functions

NUM_ Type Conversion Functions

Conversion of numbers between numerical data types may be performed by invoking the appropriate NUM_ type conversion functions, using statements such as:

RESULT = NUM_$<$T$_{1}>$TO$<$T$_{2}>$( ARG )

Here, the NUM_ function takes an argument of type $<$T$_{1}>$ and returns a result of type $<$T$_{2}>$, having performed type conversion. The data type codes $<$T$_{1}>$ and $<$T$_{2}>$ may be any of those specified in Table [*].

Thus, for example, the function NUM_BTOUW converts a byte argument to an unsigned word result, while NUM_DTOI converts from double precision to integer.

Note that conversions from floating point types (_REAL or _DOUBLE) to non-floating point types result in rounding of the data (not truncation as would happen with a Fortran assignment statement).


next up previous contents
Next: NUM_ Inter-comparison Functions
Up: THE NUM_ FUNCTIONS
Previous: NUM_ Arithmetic and Mathematical Functions

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