Hi
I was wondering if there is any way in c++ to treat a double with a given precision. for example, the number 3.1345 will be considered as 3.13 and the number 0.009 will be considered as 0 (precision of 2 after the dot).
I need that it will be applied on mathematical operations. for example:
double a = 0.009;
double b = 3.12345
//a should be considered as 0, b as 3.12
double c = a*b // should output 0.
double d = a+b // should output 3.12
since the function setprecision() is for std i was wondering if there is any other function to do that.
thanks