int

Smallest built-in integer fitting stored integer value of fi object

Syntax

int(a)

Description

int(a) returns the smallest built-in integer of the data type in which the stored integer value of fi object a fits. int(a) is equivalent to a.int.

Fixed-point numbers can be represented as

or, equivalently,

The stored integer is the raw binary number, in which the binary point is assumed to be at the far right of the word.

The following table gives the return type of the int function.

Word LengthReturn Type for Signed fiReturn Type for Unsigned fi

Word length <= 8 bits

int8

uint8

8 bits < word length <= 16 bits

int16

uint16

16 bits < word length <= 32 bits

int32

uint32

32 < word length

double

double

Examples

The following code

a = fi([-1 1],1,8,7);
y = int(a)
z = a.int

returns

y =

		 -128  127

z =

		 -128  127

See Also

int8, int16, int32, uint8, uint16, uint32

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS