Does anyone know of a type with more precision than a double?
Printable View
Does anyone know of a type with more precision than a double?
Your compiler may support "long double"
The printf/scanf flag for it is %Lf
For the decimal percision, you can always use setprecision and fixed.
setprecision and fixed are for display purposes, they don't affect the actual precision of the variable. On many current platforms, long double will have the same precision as double, although you should try using long double if you want extra precision anyway.
If you need more precision beyond that you will want a third party library that supports larger precision.
Anyone know of a third party library? In the original post I meant to type long double. All I need is about 5 more decimal places of precision.
Awesome! Thanks, Salem. That looks to be perfect for what I am doing.