Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Sometimes there is a situation when we want to check if the tested result is within the proper range.  An example of such a situation would be a function that returns the PI number. Pi is an irrational number, which means it can’t be expressed as a simple fraction.  Because of that, we are not sure with what accuracy the result will be returned. The proper approach is to test whether the function result is within the given range. In the case of Pi, the range will be from 3.1415 to 3.1416. 

...