Could someone explain this textbook example regarding float fl(x)

Click For Summary
SUMMARY

The discussion centers on the computation of fl(x) for the floating-point representation of the number 9.4. The binary representation is established as 1001.0110 0110 0110, with the decimal portion repeating. The confusion arises in understanding how fl(9.4) is derived as 9.4 + 0.2 x 2^(-49) after applying the Rounding to Nearest Rule and discarding the infinite tail. The explanation clarifies that the leading digit is standardized to 1, and the truncation and rounding processes contribute to the final representation.

PREREQUISITES
  • Understanding of binary number representation
  • Familiarity with floating-point arithmetic
  • Knowledge of rounding rules in numerical computing
  • Basic grasp of exponentiation in binary systems
NEXT STEPS
  • Study IEEE 754 floating-point standard
  • Learn about binary representation of decimal fractions
  • Explore the concept of truncation in numerical methods
  • Investigate rounding techniques in computer arithmetic
USEFUL FOR

Students of computer science, software engineers dealing with numerical computations, and anyone interested in understanding floating-point representation and arithmetic in programming.

catsarebad
Messages
69
Reaction score
0
Hi,

okay here's the problem:

*find fl(x) for 9.4*

and here's how it's done

9.4 in binary is 1001.0110 0110 0110 since
9 = 1001
.4 = .0110 0110 0110... (basically, 0110 repeating)

next using Rounding to Nearest Rule (see top on picture) we get what a binary number (boxed in black in the picture below)

I understand how to do upto here perfectly however I do not understand what happens after that.

I'm confused by pretty much the entire thing that follows after "discarding the infinite tail". I do not understand how fl(9.4) turns out to be 9.4 + 0.2 x 2^(-49) (shown in red box in the picture).

could anyone provide explanation for this?

the book has another example similar to this but i couldn't follow either of them. i hope someone can explain me the basics of what is happening here.

http://i.imgur.com/IOpfVjm.jpg

(image not embedded because it is too big and breaks the thread)
 
Technology news on Phys.org
long story short, I'm trying to figure out how

fl(9.4) = 9.4 + 0.2 x 2^(-49)

without using computer
 
I'll take a stab at it:
The binary representation of 9.4 is standardized so that the leading digit before the decimal point is 1. That is how it will be stored in the computer and it let's you know how much will be truncated. The truncated part is a bit pattern that amounts to 0.4x(2^-48). The fl rule for rounding adds a digit that amounts to 2^-49. So the final bit pattern amounts to

9.4 + rounded - truncated = 9.4 + 2^-49 - 0.4 x (2^-48).

The rest is arithmetic.
 
Last edited:

Similar threads

Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K