Exemplo n.º 1
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));
 }
Exemplo n.º 2
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));
 }
Exemplo n.º 3
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));
 }