Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Which is why you should never use == with floats/doubles, but always <=, >=, <, > and why modern compilers have warnings you can enable to tell you when you do ==.


While true, that's irrelevant to my point. The same thing occurs with this:

    if( a <= x/y )
      assert( a <= x/y );
Or with any other of the operators you mention (<, <=, >, >=).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: