• Post Reply Bookmark Topic Watch Topic
  • New Topic

IEEE 754 Floating point  RSS feed

 
chandana nalin
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IEEE 754
a = 2^20
c = -a
Find the smallest b such that (a + b) + c = a + (b + c)???
 
Campbell Ritchie
Marshal
Posts: 56525
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And? What have you done? Why are you using the exclusive‑or operator?
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, is it the float type or the double type?

... but ... I guess if you really want to know how bad the precision is for large numbers, the only way to be sure is to write a program to see. Most of the time, programmers spent time truncating (formatting), using class representations (BigDecimal), or do other tricks to prevent the loss of precision while comparing. In this case, you are going to be depending on (measuring) it...

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!