public
Created

a-plus-abs-b C#

  • Download Gist
gistfile1.cs
C#
1 2 3 4 5 6 7
private int APlusAbsB(int a, int b)
{
var oper = b > 0
? (Func<int, int, int>)((x, y) => x + y)
: (x, y) => x - y;
return oper(a, b);
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.