0

Hi,

I have an array with elements filled with values such as 36.0119. I am trying to find a way of rounding each value to the nearest whole number E.G. 36. To show i have attempted this i have used cout with the array and set precision which is ok but i need rounded results in my array. Researching this in books i found functions such as fabs, which is the best i have found. I cannot really show you any code towards this apart from:

a* = centervalue+(scalefactor*(sin(pi*a /180)));*

a = fabs(a);

cout << a*; //using this to check results from fabs function*

im sure a rounding function is easy! but i just cannot find it or get one to work!

thanks for looking