Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: Français - Português - 日本語 - Русский

Please note that the recommended version of Scilab is 6.0.2. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> Integers > iconvert

iconvert

conversion to 1 to 8 byte integer representation

Syntax

y = iconvert(X, itype)

Arguments

X

a matrix of floats or integers.

itype

an integer, a type of conversion.

y

a matrix of integers coded on 1, 2, 4 or 8 bytes.

Description

The iconvert function converts and stores data to 1, 2, 4 or 8 bytes integers.

itype = 0

return floating point numbers

itype = 1

return int8 numbers in the range [-128, 127]

itype = 11

return uint8 numbers in the range [0, 255]

itype = 2

return int16 numbers in the range [-32768, 32767]

itype = 12

return uint16 numbers in the range [0, 65535]

itype = 4

return int32 numbers in the range [-2147483648, 2147483647]

itype = 14

return uint32 numbers in the range [0, 4294967295]

itype = 8

return int64 numbers in the range [-9223372036854775808,9223372036854775807]

itype = 18

return uint64 numbers in the range [0, 18446744073709551616]

Examples

b=int32([1 -120 127 312])
y=iconvert(b,1)

typeof(b)
typeof(y)

See also

  • double — converts inttype integers or booleans into decimal encoding
  • int8 — conversion to one byte integer representation
  • inttype — type integers used in integer data types
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 14 15:02:52 CET 2017