>Console.WriteLine(" 2.Between(1,3) {0}", 2.BetweenX(1, 3)); >>
> IL_0000: ldstr " 2.Between(1,3) {0}" > IL_0005: ldc.i4.2 > IL_0006: box [mscorlib]System.Int32 > IL_000b: ldc.i4.1 > IL_000c: box [mscorlib]System.Int32 > IL_0011: ldc.i4.3 > IL_0012: box [mscorlib]System.Int32 > IL_0017: call bool GregoryAdam.Base.ExtensionMethods.ExtensionMethods::BetweenX(class [mscorlib]System.IComparable, > class [mscorlib]System.IComparable, > class [mscorlib]System.IComparable) >>
>#if true > // 3 times slower > public static bool BetweenX(this IComparable s, IComparable s1, IComparable s2) > { > return (s.CompareTo(s1) >= 0) && (s.CompareTo(s2) <= 0); > } >#endif >