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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Basic data typesFLOATING-POINT TYPESIn the <strong>MSP430</strong> <strong>IAR</strong> C/<strong>C++</strong> <strong>Compiler</strong>, floating-point values are represented in standardIEEE 754 format. The sizes for the different floating-point types are:Type Size if --double=32 Size if --double=64float 32 bits 32 bitsdouble 32 bits (default) 64 bitslong double 32 bits 64 bitsTable 31: Floating-point typesNote: The size of double and long double depends on the --double={32|64}option, see --double, page 150. The type long double uses the same precision asdouble.The compiler does not support subnormal numbers. All operations that should producesubnormal numbers will instead generate zero.Exception flags according to the IEEE 754 standard are not supported.32-bit floating-point formatThe representation of a 32-bit floating-point number as an integer is:31 30 23 22 0S Exponent MantissaThe exponent is 8 bits, and the mantissa is 23 bits.The value of the number is:(-1) S * 2 (Exponent-127) * 1.MantissaThe range of the number is:±1.18E-38 to ±3.39E+38The precision of the float operators (+, -, *, and /) is approximately 7 decimal digits.172<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!