11.07.2015 Views

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

SHOW MORE
SHOW LESS
  • No tags were found...

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

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

Descriptions of implementation-defined behaviorINTEGERSRange of integer values (6.1.2.5)The representation of integer values are in the two's complement form. The mostsignificant bit holds the sign; 1 for negative, 0 for positive and zero.See Basic data types, page 170, for information about the ranges for the different integertypes.Demotion of integers (6.2.1.2)Converting an integer to a shorter signed integer is made by truncation. If the valuecannot be represented when converting an unsigned integer to a signed integer of equallength, the bit-pattern remains the same. In other words, a large enough value will beconverted into a negative value.Signed bitwise operations (6.3)Bitwise operations on signed integers work the same way as bitwise operations onunsigned integers; in other words, the sign-bit will be treated as any other bit.Sign of the remainder on integer division (6.3.5)The sign of the remainder on integer division is the same as the sign of the dividend.Negative valued signed right shifts (6.3.7)The result of a right-shift of a negative-valued signed integral type preserves the sign-bit.For example, shifting 0xFF00 down one step yields 0xFF80.FLOATING POINTRepresentation of floating-point values (6.1.2.5)The representation and sets of the various floating-point numbers adheres to IEEE854–1987. A typical floating-point number is built up of a sign-bit (s), a biasedexponent (e), and a mantissa (m).See Floating-point types, page 172, for information about the ranges and sizes for thedifferent floating-point types: float and double.Converting integer values to floating-point values (6.2.1.3)When an integral number is cast to a floating-point value that cannot exactly representthe value, the value is rounded (up or down) to the nearest suitable value.254<strong>MSP430</strong> <strong>IAR</strong> C/<strong>C++</strong> <strong>Compiler</strong>Reference Guide

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

Saved successfully!

Ooh no, something went wrong!