0
I seem to have an issue adding float numbers in c++.
Im trying to calculate eulers number but when i try to add the float numbers it wont let me. My code: https://code.sololearn.com/crlhy7DTqjVi/?ref=app https://code.sololearn.com/crlhy7DTqjVi/?ref=app
4 Respostas
+ 3
How so?
This outputs a float
https://code.sololearn.com/cVDjxb42Y5z8/?ref=app
+ 2
To adjust decimal points, use `setprecision` from <iomanip>
http://cplusplus.com/reference/iomanip/setprecision/
+ 1
Because s is an integer. s would need to be a float for that.
0
Slick Felix Alcor thanks a lot guys, that worked. Any idea why it wont go past the 5th decimal point? I even tried long double.