07.04.2013 Views

MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip

MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip

MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

16-Bit C <strong>Compiler</strong> User’s Guide<br />

A.7 INTEGERS<br />

A.8 FLOATING POINT<br />

Implementation-Defined Behavior <strong>for</strong> Integers is covered in section G.3.5 of the ANSI<br />

C St<strong>and</strong>ard.<br />

The following table describes the amount of storage <strong>and</strong> range of various types of<br />

integers: (ISO 6.1.2.5)<br />

TABLE A-2: INTEGER TYPES<br />

Designation Size (bits) Range<br />

char 8 -128 … 127<br />

signed char 8 -128 … 127<br />

unsigned char 8 0 … 255<br />

short 16 -32768 … 32767<br />

signed short 16 -32768 … 32767<br />

unsigned short 16 0 … 65535<br />

int 16 -32768 … 32767<br />

signed int 16 -32768 … 32767<br />

unsigned int 16 0 … 65535<br />

long 32 -2147483648 … 2147438647<br />

signed long 32 -2147483648 … 2147438647<br />

unsigned long 32 0 … 4294867295<br />

What is the result of converting an integer to a shorter signed integer, or the result of<br />

converting an unsigned integer to a signed integer of equal length, if the value cannot<br />

be represented? (ISO 6.2.1.2)<br />

There is a loss of significance. No error is signaled.<br />

What are the results of bitwise operations on signed integers? (ISO 6.3)<br />

Shift operators retain the sign. Other operators act as if the oper<strong>and</strong>(s) are unsigned<br />

integers.<br />

What is the sign of the remainder on integer division? (ISO 6.3.5)<br />

+<br />

What is the result of a right shift of a negative-valued signed integral type? (ISO 6.3.7)<br />

The sign is retained.<br />

Implementation-Defined Behavior <strong>for</strong> Floating Point is covered in section G.3.6 of the<br />

ANSI C St<strong>and</strong>ard.<br />

Is the scaled value of a floating constant that is in the range of the representable value<br />

<strong>for</strong> its type, the nearest representable value, or the larger representable value immediately<br />

adjacent to the nearest representable value, or the smallest representable value<br />

immediately adjacent to the nearest representable value? (ISO 6.1.3.1)<br />

The nearest representable value.<br />

DS51284H-page 132 © 2008 <strong>Microchip</strong> Technology Inc.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!