예제 #1
0
 /// <summary>
 ///     Computes the average of a flow of numbers.
 /// </summary>
 /// <param name="flow">Input CloudFlow.</param>
 /// <returns>A cloud computation that computes the average of suplied workflow.</returns>
 public static Cloud <double> Average(this CloudFlow <long> flow)
 {
     return(flow.Select(i => (double)i).Average());
 }
예제 #2
0
 /// <summary>Returns the sum of the elements.</summary>
 /// <param name="flow">The input CloudFlow.</param>
 /// <returns>The sum of the elements.</returns>
 public static Cloud <decimal> Sum(this CloudFlow <decimal?> flow)
 {
     return(flow.Select(value => value.GetValueOrDefault(0)).Sum());
 }