예제 #1
0
 /// <summary>
 /// Evaluates binary addition (+) for the given type(s); this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static TArg1 AddAlternative <TArg1, TArg2>(TArg1 value1, TArg2 value2)
 {
     return(GenericMath <TArg2, TArg1> .Add(value1, value2));
 }
예제 #2
0
 /// <summary>
 /// Performs a conversion between the given types; this will throw
 /// an InvalidOperationException if the type T does not provide a suitable cast, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this cast.
 /// </summary>
 public static TTo Convert <TFrom, TTo>(TFrom value)
 {
     return(GenericMath <TFrom, TTo> .Convert(value));
 }
예제 #3
0
 /// <summary>
 /// Evaluates binary addition (+) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static T Add <T>(T value1, T value2)
 {
     return(GenericMath <T> .Add(value1, value2));
 }
예제 #4
0
 /// <summary>
 /// Evaluates bitwise not (~) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static T Not <T>(T value)
 {
     return(GenericMath <T> .Not(value));
 }
예제 #5
0
 /// <summary>
 /// Evaluates bitwise xor (^) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static T Xor <T>(T value1, T value2)
 {
     return(GenericMath <T> .Xor(value1, value2));
 }
예제 #6
0
 /// <summary>
 /// Evaluates binary less-than-or-equal (&lt;=) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static bool LessThanOrEqual <T>(T value1, T value2)
 {
     return(GenericMath <T> .LessThanOrEqual(value1, value2));
 }
예제 #7
0
 /// <summary>
 /// Evaluates integer division (/) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary><remarks>
 /// This operation is particularly useful for computing averages and
 /// similar aggregates.
 /// </remarks>
 public static T DivideInt32 <T>(T value, int divisor)
 {
     return(GenericMath <int, T> .Divide(value, divisor));
 }
예제 #8
0
 /// <summary>
 /// Evaluates unary negation (-) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static T Negate <T>(T value)
 {
     return(GenericMath <T> .Negate(value));
 }
예제 #9
0
 /// <summary>
 /// Evaluates binary greater-than-on-eqauls (&gt;=) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static bool GreaterThanOrEqual <T>(T value1, T value2)
 {
     return(GenericMath <T> .GreaterThanOrEqual(value1, value2));
 }
예제 #10
0
 /// <summary>
 /// Evaluates binary division (/) for the given type(s); this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static TArg1 DivideAlternative <TArg1, TArg2>(TArg1 value1, TArg2 value2)
 {
     return(GenericMath <TArg2, TArg1> .Divide(value1, value2));
 }
예제 #11
0
 /// <summary>
 /// Evaluates binary inequality (!=) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static bool NotEqual <T>(T value1, T value2)
 {
     return(GenericMath <T> .NotEqual(value1, value2));
 }
예제 #12
0
 /// <summary>
 /// Evaluates binary division (/) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static T Divide <T>(T value1, T value2)
 {
     return(GenericMath <T> .Divide(value1, value2));
 }
예제 #13
0
 /// <summary>
 /// Evaluates binary multiplication (*) for the given type(s); this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static TArg1 MultiplyAlternative <TArg1, TArg2>(TArg1 value1, TArg2 value2)
 {
     return(GenericMath <TArg2, TArg1> .Multiply(value1, value2));
 }
예제 #14
0
 /// <summary>
 /// Evaluates binary multiplication (*) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static T Multiply <T>(T value1, T value2)
 {
     return(GenericMath <T> .Multiply(value1, value2));
 }
예제 #15
0
 /// <summary>
 /// Evaluates binary subtraction(-) for the given type(s); this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static TArg1 SubtractAlternative <TArg1, TArg2>(TArg1 value1, TArg2 value2)
 {
     return(GenericMath <TArg2, TArg1> .Subtract(value1, value2));
 }
예제 #16
0
 /// <summary>
 /// Evaluates binary subtraction (-) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static T Subtract <T>(T value1, T value2)
 {
     return(GenericMath <T> .Subtract(value1, value2));
 }