Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. ```C#
  2. /// <summary>
  3. /// Determines if is between the specified float is between two given floats.
  4. /// </summary>
  5. /// <returns><c>true</c> if the float is between the specified num lower upper inclusive; otherwise, <c>false</c>.</returns>
  6. /// <param name="num">Number.</param>
  7. /// <param name="lower">Lower.</param>
  8. /// <param name="upper">Upper.</param>
  9. /// <param name="inclusive">If set to <c>true</c> inclusive.</param>
  10. public static bool IsBetween (this float num, float lower, float upper, bool inclusive = false)
  11. {
  12. return inclusive
  13. ? lower <= num && num <= upper
  14. : lower < num && num < upper;
  15. }
  16. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement