Hi every one....

i have problem in c++ , i hope i find the solution for it :-| :-| :-| .

i want store number like 2.000000000002
12-13 digits after comma

it's important to me these digits.

i'm sorry if my english language is not good ,but this is all i can
forgive me guys.

Recommended Answers

double in C++ has a 64-bit precision. long double has the same I think, which leaves you with the opportunity to use either double, or if it's not good enough for you, you can use something like this: http://members.lycos.co.uk/keithmbriggs/doubledouble.html

Jump to Post

All 3 Replies

I'd go with the doubledouble special datatype, since the regular double can only barely hold enough precision for your digits -- and if you do any interesting math with the numbers, the floating point error will be too much.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.