Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.0 - English

Change language to:
Français - 日本語 - Português - Русский

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

Scilab Help >> Integers > int8

int8

conversion to one byte integer representation

int16

conversion to 2 bytes integer representation

int32

conversion to 4 bytes integer representation

int64

conversion to 8 bytes integer representation

uint8

conversion to one byte unsigned integer representation

uint16

conversion to 2 bytes unsigned integer representation

uint32

conversion to 4 bytes unsigned integer representation

uint64

conversion to 8 bytes unsigned integer representation

Syntax

y = int8(X)
y = int16(X)
y = int32(X)
y = int64(X)
y = uint8(X)
y = uint16(X)
y = uint32(X)
y = uint64(X)

Arguments

X

a matrix of floats or integers.

y

a matrix of integers coded on one, two or four bytes.

Description

These functions convert and store data to one, two or four bytes integers. These data types are especially useful to store big objects such as images, long signals,...

y = int8(X)

return numbers in the range [-128, 127]

y = uint8(X)

return numbers in the range [0, 255]

y = int16(X)

return numbers in the range [-32768, 32767]

y = uint16(X)

return numbers in the range [0, 65535]

y = int32(X)

return numbers in the range [-2147483648, 2147483647]

y = uint32(X)

return numbers in the range [0, 4294967295]

y = int64(X)

return numbers in the range [-9223372036854775808,9223372036854775807]

y = uint64(X)

return numbers in the range [0, 18446744073709551616]

If X has numbers with a fractional part, Scilab rounds them to the nearest integer toward zero.

Examples

int8([1 -120 127 312])
uint8([1 -120 127 312])

x = int32(-200:100:400)
int8(x)

y = [-3.8, -3.5, -3.1, 3.1, 3.5, 3.8]
int8(y)

See also

  • double — converts inttype integers or booleans into decimal encoding
  • inttype — type integers used in integer data types
  • iconvert — conversion to 1 to 8 byte integer representation
Report an issue
<< iconvert Integers inttype >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
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