'via Blog this'
I love extensions. Handy candy, though! Check their page out:
And can be easily used like this:1: public static class IntExtensions2: {3: public static int Half(this int source)4: {5: return source / 2;6: }7:8: public static int Cube(this int source)9: {10: return (int)Math.Pow(source, 3);11: }12:13: public static int Square(this int source)14: {15: return (int)Math.Pow(source, 2);16: }17: }
2: var ans = 13.Cube().Half().Square();
No comments:
Post a Comment