Light.GuardClauses icon indicating copy to clipboard operation
Light.GuardClauses copied to clipboard

Add assertions for checking if a floating point value is greater / less than or approximately equal to another value

Open feO2x opened this issue 5 years ago • 0 comments

This feature should be implemented for double and float values. The assertions should be overloaded so that the tolerance can be specified by the caller. See IsApproximately for double and float as a reference.

Candidates are:

  • static bool IsGreaterThanOrApproximately(this double value, double other)
  • static bool IsGreaterThanOrApproximately(this double value, double other, double tolerance)
  • static bool IsGreaterThanOrApproximately(this float value, float other)
  • static bool IsGreaterThanOrApproximately(this float value, float other, float tolerance)
  • static bool IsLessThanOrApproximately(this double value, double other)
  • static bool IsLessThanOrApproximately(this double value, double other, double tolerance)
  • static bool IsLessThanOrApproximately(this float value, float other)
  • static bool IsLessThanOrApproximately(this float value, float other, float tolerance)

feO2x avatar Jun 15 '20 12:06 feO2x