Jump to content

Ethiopian multiplication: Difference between revisions

m
Line 485:
.Select ( ( item ) => Enumerable.Repeat ( new { Col1 = p_NumberA, Col2 = p_NumberB }, item )
.Aggregate ( ( agg_pair, orig_pair ) => new { Col1 = agg_pair.Col1.Halve ( ), Col2 = agg_pair.Col2.Double ( ) } ) )
.SumWhere ( pair => !pair.Col1.IsEven ( ) ? 0 : pair.Col2 );
.Sum ( pair => pair.Col2 );
}
}
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.