- #1
Leonardo Machado
- 57
- 2
Hello friends, today i have this question about precision. Actually I'm trying to do a simple use of the pow function for a small number x=0.005 squared. By entrying pow ( x, 2) my console does not output the proper number 0.000025, but some memory error.
I've read about it and i may be able to change how many characters i want to see in console by using the comand:
for an arbitrary number of characters n.
It is a function of <iomanip> and only has effects on the presentations of data in console, does not accurate the math opperators ( for y / pow ( x, 2) for example), and that is what i need, I've heard about a library called GMP, created by this propose, is that right ? Do you guys have any tips about it ?
I've read about it and i may be able to change how many characters i want to see in console by using the comand:
Code:
cout << setprecision (n) << pow ( x, 2);
for an arbitrary number of characters n.
It is a function of <iomanip> and only has effects on the presentations of data in console, does not accurate the math opperators ( for y / pow ( x, 2) for example), and that is what i need, I've heard about a library called GMP, created by this propose, is that right ? Do you guys have any tips about it ?