Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```C#
- /// <summary>
- /// Determines if is between the specified float is between two given floats.
- /// </summary>
- /// <returns><c>true</c> if the float is between the specified num lower upper inclusive; otherwise, <c>false</c>.</returns>
- /// <param name="num">Number.</param>
- /// <param name="lower">Lower.</param>
- /// <param name="upper">Upper.</param>
- /// <param name="inclusive">If set to <c>true</c> inclusive.</param>
- public static bool IsBetween (this float num, float lower, float upper, bool inclusive = false)
- {
- return inclusive
- ? lower <= num && num <= upper
- : lower < num && num < upper;
- }
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement