 integer - Maple Help

MTM[int8], MTM[int16], MTM[int32], MTM[int64]

convert to integer

MTM[uint8], MTM[uint16], MTM[uint32], MTM[uint64]

convert to unsigned integer Calling Sequence int8(A) int16(A) int32(A) int64(A) uint8(A) uint16(A) uint32(A) uint64(A) Parameters

 A - an expression, or an array, matrix, or vector of expressions Description

 • The int32(A) functions evaluate each element of A numerically and round the result to the nearest integer value that fits in the specified number of bits.
 • The range of int8 is -2^7 .. 2^7-1 or -128 .. 127
 • The range of int16 is -2^15 .. 2^15-1 or -32768 .. 32767
 • The range of int32 is -2^31 .. 2^31-1 or -2147483648 .. 2147483647
 • The range of int64 is -2^63 .. 2^63-1 or -9223372036854775808 ..  9223372036854775807
 • The range of uint8 is 0 .. 2^8-1 or 0 .. 255
 • The range of uint16 is 0 .. 2^16-1 or 0 .. 65535
 • The range of uint32 is 0 .. 2^32-1 or 0 .. 4294967295
 • The range of uint64 is 0 .. 2^64-1 or 0 .. 18446744073709551615
 • A value under the minimum range is increased to the minimum. A value over the maximum range is reduced to the maximum.
 • If possible, the computation is done using the floating-point hardware of the underlying system using evalhf.
 • Division by zero will be trapped and the maximum integer value for the specified precision is returned instead of raising an error. Examples

 > $\mathrm{with}\left(\mathrm{MTM}\right):$
 > $\mathrm{int32}\left(\mathrm{Pi}\right)$
 ${3}$ (1)
 > $A≔\mathrm{Array}\left(\left[-\mathrm{∞},\mathrm{∞},3.2\right]\right):$
 > $\mathrm{int32}\left(A\right)$
 $\left[\begin{array}{ccc}{-2147483648}& {2147483647}& {3}\end{array}\right]$ (2)
 > $\mathrm{uint16}\left(A\right)$
 $\left[\begin{array}{ccc}{0}& {65535}& {3}\end{array}\right]$ (3)