IEEE 754 Calculator

Binary Floating Point Addition Calculator

Add two floating-point numbers and inspect their IEEE 754 representations. Compare 32-bit single precision with 64-bit double precision, view sign, exponent and fraction bits, inspect hexadecimal encodings, and learn how rounding affects the result.

Floating-Point Addition

Results are calculated in your browser. The page does not submit a form or reload when you calculate.

Enter values such as 1.5, -2.25, 0.1 or 1e-6.

What Is Binary Floating-Point Addition?

Binary floating-point arithmetic represents a number using a sign, an exponent and a significand. IEEE 754 defines widely used formats for storing these numbers and specifies how basic arithmetic results are rounded when they cannot be represented exactly. Read an IEEE 754 background guide.

This calculator adds two operands in either binary32 single precision or binary64 double precision. In decimal input mode, each operand is first converted to the selected format, and the two represented values are added. The result is then rounded to that format.

How IEEE 754 Stores a Number

Each supported format divides its bits into three fields:

Property Binary32 Binary64
Total bits3264
Sign bits11
Exponent bits811
Fraction bits2352
Exponent bias1271023
Approximate decimal precision7 significant digits15–16 significant digits

How Floating-Point Addition Works

Conceptually, floating-point addition involves aligning the operands' exponents, adding or subtracting their significands according to their signs, normalizing the result when necessary, and rounding to the selected precision. Hardware performs these steps according to the floating-point format's arithmetic rules.

  1. Decode: identify each operand's sign, exponent and significand.
  2. Align: express the significands at a common exponent.
  3. Add or subtract: combine the significands, taking account of the operand signs.
  4. Normalize: adjust the significand and exponent to the appropriate form.
  5. Round: store the result using the precision and range of the selected format.

The calculator displays a conceptual breakdown and the actual bit representation. It does not claim to expose the processor's internal guard, round and sticky bits or every hardware micro-operation.

Why Is 0.1 + 0.2 Not Always Exactly 0.3?

Many decimal fractions have repeating binary expansions. Because binary32 and binary64 have a finite number of significand bits, values such as 0.1 and 0.2 are generally stored as nearby representable numbers rather than their exact decimal values.

The addition therefore operates on the stored approximations. The displayed result depends on the selected precision. This is normal floating-point behavior, not necessarily a calculator error.

Single Precision Versus Double Precision

Binary32 uses 32 bits and is often used where memory or bandwidth is important. Binary64 uses 64 bits and normally provides substantially more precision and a wider exponent range. Neither format can exactly represent every real number.

If a value is already represented in binary32, converting it to binary64 preserves that binary32 value exactly. It does not recover decimal information lost when the original value was first rounded to binary32.

Using Raw Binary or Hexadecimal Input

Choose raw hexadecimal or binary mode to inspect existing IEEE 754 encodings. A binary32 pattern contains exactly 32 bits or 8 hexadecimal digits; a binary64 pattern contains exactly 64 bits or 16 hexadecimal digits. In these modes, the calculator decodes each bit pattern and adds the represented values in the selected format.

Binary32 example: 1.5 = 0x3FC00000
Binary32 example: 2.25 = 0x40100000
Sum: 3.75 = 0x40700000

Special Values

IEEE 754 also supports positive and negative zero, subnormal values, positive and negative infinity, and NaN (Not a Number). These values have special exponent and fraction patterns. The calculator identifies the decoded result classification when applicable.

Frequently Asked Questions

1. What does this binary floating-point calculator calculate?

It adds two operands in IEEE 754 binary32 or binary64 precision and displays the decimal result, binary bits, hexadecimal encoding, sign, exponent and fraction fields.

2. Can I calculate negative floating-point sums?

Yes. Decimal input accepts negative values, and raw binary or hexadecimal input can represent negative numbers through the IEEE 754 sign bit.

3. Why do binary32 and binary64 results differ?

Binary32 has fewer significand bits than binary64. A result that requires more precision may therefore round differently in single precision.

4. Does hexadecimal input mean an ordinary hexadecimal number?

No. In raw hexadecimal mode, the digits represent the complete IEEE 754 encoding, not an integer to be interpreted as a numeric value directly.

5. Does the calculator send my numbers to a server?

No. The calculation runs in your browser using JavaScript. The PHP file serves the page, but the operands are processed locally.

6. Can every floating-point sum be exact?

No. A finite-precision format cannot represent every real number or every possible sum. IEEE 754 arithmetic rounds results when required by the selected format.

Related Binary Tools

Continue exploring binary arithmetic and number representations.