Does anyone know of a type with more precision than a double?
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
Callou collei we'll code the way
Of prime numbers and pings!
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.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Awesome! Thanks, Salem. That looks to be perfect for what I am doing.