• Advertisement

Daan Niphuis

  • Content count

  • Joined

  • Last visited

Community Reputation

103 Neutral

About Daan Niphuis

  • Rank
  1. Result of certain floating point operations

    [quote name='clb' timestamp='1340030371' post='4950265'] [quote name='alvaro' timestamp='1340027618' post='4950243'] Third and fourth cases will break if a == b. [/quote] Heh, was so fixed on the IEEE peculiarities, that didn't even consider the natural reasons [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] [/quote] Hmmm, sorry about that. I forgot to mention a != b and are both finite. I did some tests and some equations can indeed be untrue for large values of a and b.
  2. Hello, I have a question regarding the result of IEEE floating point operations. I was wondering if the following statements are always true a == a + 0.0f * (b - a) b == a + 1.0f * (b - a) 1.0f == (a - b) / (a - b) 0.0f == (a - a) / (a - b) where a and b are floating point numbers.
  • Advertisement