Difference between double and long double in C ++

Can anyone explain the differences between doubles and long doubles, except for the difference in precision for me? I wrote a program to solve the n-body gravity problem, so I mainly integrate second order differential equations, and my program works great using doublings. However, when I replace all the doubles I use with long doublings, all the calculations seem to give meaningless results. Can anyone explain the reason for this?

Contrary to what everyone seems to think that I cannot find the tags I am looking for on a long double and double strand.

+3


source to share


1 answer


Maybe refer here: Why are you using float over double or double over long double?

But just long usually refers to something like int.



I think you are looking for a long double ... If you only bet long it will mess up your code because its not double or float ...

Data types are looked up here: http://en.wikipedia.org/wiki/C_data_types

0


source







All Articles