Enter a decimal number into the calculator to convert it into its floating point representation.
Related Calculators
- Floating Point Normalization Calculator
- Rounding Calculator
- Exponent Calculator
- Relative Error Calculator
- All Math and Numbers Calculators
Decimal To Floating Point Formula
The following equation is used to convert a decimal number into its floating point representation.
F = (-1)^s \times (1.M) \times 2^{(E-127)}- Where F is the floating point number
- s is the sign bit (0 for positive, 1 for negative)
- E is the exponent (8-bit binary with a bias of 127)
- M is the mantissa (23-bit binary value)
To convert a decimal to floating point, the calculator computes the sign bit, exponent, and mantissa of the number.
| Decimal | Sign Bit | Exponent (Binary) | Mantissa (Binary) |
|---|---|---|---|
| -16 | 1 | 10000011 | 00000000000000000000000 |
| -8 | 1 | 10000010 | 00000000000000000000000 |
| -4 | 1 | 10000001 | 00000000000000000000000 |
| -3.5 | 1 | 10000000 | 11000000000000000000000 |
| -2.5 | 1 | 10000000 | 01000000000000000000000 |
| -2 | 1 | 10000000 | 00000000000000000000000 |
| -1.5 | 1 | 01111111 | 10000000000000000000000 |
| -1 | 1 | 01111111 | 00000000000000000000000 |
| -0.5 | 1 | 01111110 | 00000000000000000000000 |
| 0 | 0 | 00000000 | 00000000000000000000000 |
| 0.25 | 0 | 01111101 | 00000000000000000000000 |
| 0.5 | 0 | 01111110 | 00000000000000000000000 |
| 0.75 | 0 | 01111110 | 10000000000000000000000 |
| 1 | 0 | 01111111 | 00000000000000000000000 |
| 1.5 | 0 | 01111111 | 10000000000000000000000 |
| 2 | 0 | 10000000 | 00000000000000000000000 |
| 3 | 0 | 10000000 | 10000000000000000000000 |
| 4 | 0 | 10000001 | 00000000000000000000000 |
| 8 | 0 | 10000010 | 00000000000000000000000 |
| 10 | 0 | 10000010 | 01000000000000000000000 |
| IEEE 754 single-precision (32-bit). Exponent bias = 127. For normalized numbers the leading 1 of the significand is implicit. Zero is represented with exponent 00000000 and mantissa 000…0. | |||
What is a Floating Point Number?
Definition:
A floating point number is a method of representing real numbers that can support a vast range of values by using a combination of a sign, an exponent, and a mantissa. This format is widely used in computing to perform arithmetic operations with both very large and very small numbers.
How to Convert a Decimal to Floating Point?
Example Problem:
The following example outlines the steps needed to convert a decimal number to its floating point components.
First, enter the decimal number. In this example, we will convert 10.5.
Next, the calculator processes the number to extract the 32-bit floating point components.
Finally, determine the floating point representation using the formula above:
F = (-1)^s × (1.M) × 2^(E-127)
F = (-1)^0 × (1.01010000000000000000000) × 2^(130-127)
F = 1 × 1.01010000000000000000000 × 2^3
FAQ
How does floating point representation work?
Floating point representation divides a number into a sign bit, an exponent, and a mantissa, enabling a wide range of values to be represented in binary form.
Why is the exponent biased in floating point numbers?
The bias, typically 127 for single precision, allows the exponent to represent both positive and negative values without a separate sign bit.
What are some limitations of using floating point arithmetic?
Floating point arithmetic can lead to rounding errors and slight precision loss, especially when dealing with very large or very small numbers.