CSharp examples for System:Math Number
Returns if the value is in between or equal to max and min
/// A port of the LoDMath static member class written in AS3 under the MIT license agreement. using System.Linq; using System.Collections.Generic; using System;/*from w w w . ja va 2s . c om*/ public class Main{ public static bool InRange(double value, double max) { return InRange(value, max, 0); } /// <summary> /// Returns if the value is in between or equal to max and min /// </summary> /// <param name="value"></param> /// <param name="max"></param> /// <param name="min"></param> /// <returns></returns> /// <remarks></remarks> public static bool InRange(double value, double max, double min) { return (value >= min && value <= max); } }