math function in c# with example