erikwiffin / 0.30000000000000004

Floating Point Math Examples

Home Page:https://0.30000000000000004.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[C++] setprecision() uses the std namespace

Bruflot opened this issue · comments

The C++ example is as follows:

std::cout << setprecision(17) << 0.1 + 0.2 << std.endl;

The function setprecision() uses the std namespace, and should therefore be written as such. Same goes for endl. Furthermore, the C example also works in C++; perhaps these should be merged?

If you send me a PR on the subject I'd be happy to merge it.