Next: assignment Up: MacAnova Help File Previous: asin()   Contents

# asLong()

Usage:
 ```asLong(x), x REAL with no MISSING values and with integer values between -2147483647 and 2147483647 = 2^31-1. ```

Keywords: transformations, variables
```asLong(x), where x is REAL returns a LONG variable the same size and
shape as x, but with all of its elements represented as integers instead
of floating point values.  All the elements of REAL scalar, vector,
matrix or array x must be exact integers with values between -2147483647
and 2147483647 = 2^31-1.

The only use at present for asLong() is to create a long integer
argument to a user function called by User().  When the argument is
returned it is "coerced" to an equivalent REAL variable.  For example,
User("foo", result:asLong(20)) will return a REAL integer scalar value.

asLong(x) is also legal as an argument to print() and write().  For
example, print(asLong(vector(1,3,5,2))) produces the same output as
print(vector(1,3,5,2)).

When assigned (y <- asLong(x)), a LONG variable is "coerced" to a
ordinary REAL variable.  For example, a <- asLong(vector(1,3,5,2))
has the same effect as a <- vector(1,3,5,2).