Chapter Contents
NAG Toolbox

NAG Toolbox: nag_int

Purpose

nag_int generates integer values of type int32 or int64 depending on the implementation of the toolbox in use.

Syntax

[ival] = nag_int(val)

Description

nag_int casts a double value to either int32 or int64 depending on the implementation of the toolblox in use. The main use of this function is to allow code to be written that is portable between the 32 and 64 bit versions of the Toolbox.
See also Integers section in Calling NAG Routines from MATLAB.

References

None.

Parameters

Input Parameter

1:     val – matlab value
Typically this is a scalar double value or an array of doubles.

Output Parameter

1:     ival – matlab value
The input value will be cast to int32 or int64 using the primitive matlab int32 or int32 function as appropriate.

Error Indicators and Warnings

None.

Example

[ival] = nag_int(2)
ival =
                    2

Chapter Contents
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2011