Floating Point

The questions below are due on Sunday September 27, 2026; 11:59:00 PM.
 
You are not logged in.

Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.
Back to Exercises

Floating point Representation

Floating point to decimal

What is the decimal equivalent of 32-bit floating point number 0b1011_1111_0010_0000_0000_0000_0000_0000?

What is the decimal equivalent of 32-bit floating point number 0x44F00000?

Decimal to floating point

Write the number -2.625 in 32-bit floating point representation. Write your answer in hexadecimal: 0x

Write the number 0.21875 in 32-bit floating point representation. Write your answer in hexadecimal: 0x

Floating point precision

Floating point presents a difficult challenge: how do we represent every possible decimal combination? Given a fixed number of bits, the answer is: we can't. As a result, there are some numbers that we would like to represent in floating point, but cannot represent them exactly.

For the following questions, you will be presented a value or expression in decimal, and asked if it can be represented in 32-bit floating point.

\frac{ 2 }{ 5 }

\frac{ 697 }{ 512 }

0.3

Logical Floating Point Operators: Comparison (==, !=, <, <=, > >=)

Logical operators take two numbers and produce a 0 (to indicate false) or 1 (to indicate true) output.

What is the result of the following logical comparisons assuming that the binary and hexadecimal values shown represent floating point numbers?

0b1100_0001_0101_0000_0000_0000_0000_0000 <= 0b0100_0010_0011_1000_0000_0000_0000_0000

0b0100_0011_0010_1000_0000_0000_0000_0000 > 0b0100_0000_0111_1000_0000_0000_0000_0000

0xC1080000 < 0xC3A00000

0xC1D439D0 > 0x3F42B06C

0x40B00000 < 0x40900000

Back to Exercises