Learn Python

 

FloatTricks

Page history last edited by peter 1 yr ago


 

floats are fuzzy around the edges and not "dense" enough

 

  • Never do: "The difference between two floats is equal to..."
  • Do: "The difference between two floats is in the range ..."
    • But even 2 needs some serious thinking if the range of float values being compared is large.

here is error and What Every Computer Scientist Should Know About Floating-Point Arithmetic

Comments (0)

You don't have permission to comment on this page.