decimals

if I wanted to take the blow and produce 3.0000001, what would I define c as ???

??? c = 5.0 - 1.9999999;
I tried it and a double works fine.
Crazy. I have double and using VC10. Simple, even tried with linux compiler. Same thing, just getting 3.

I don't get it but appreciate your answer.
Thanks
Try this :

1
2
3
4
5
6
7
8
9
#include <iostream>
#include <iomanip>

int main()
{
    double c = 5.0 - 1.9999999;

    std::cout << std::setprecision(9) << c << std::endl;
} 
I should be able to do it without the setprecision. idk.. frustrating
Topic archived. No new replies allowed.