• Artificial Intelligence
  • Embedded Systems
  • Quantitative Trading

IEEE 754 Floating-Point Converter

Convert decimal numbers to IEEE 754 binary representation

-
-
Sign -
Exponent -
Mantissa -

How IEEE 754 Works

IEEE 754 is a technical standard for floating-point arithmetic established by the Institute of Electrical and Electronics Engineers (IEEE). It defines how computers represent and manipulate decimal numbers in binary format.

Structure

IEEE 754 floating-point numbers are divided into three parts:

Sign Bit

1 bit determining if the number is positive (0) or negative (1)

Exponent

8 bits (single) or 11 bits (double) for the power of 2, using biased representation

Mantissa (Fraction)

23 bits (single) or 52 bits (double) for the significant digits

Formula

Value = (-1)sign × 2(exponent - bias) × (1 + mantissa)

  • Bias: 127 for single precision (32-bit), 1023 for double precision (64-bit)
  • Single Precision: 1 sign bit + 8 exponent bits + 23 mantissa bits = 32 bits
  • Double Precision: 1 sign bit + 11 exponent bits + 52 mantissa bits = 64 bits
  • Range: Single precision: ±1.18×10-38 to ±3.4×1038
  • Precision: Single: ~7 decimal digits, Double: ~15-16 decimal digits

Special Values

  • Zero: All exponent and mantissa bits are 0
  • Infinity: All exponent bits are 1, all mantissa bits are 0
  • NaN (Not a Number): All exponent bits are 1, mantissa is non-zero