You joke, but that's one option to take when you need specific decimal precision and a guarantee that you won't have to deal with floating point precision errors, like when dealing with money. Work on integers and then shift the decimal after you're done.
View all comments
94
u/Zearen_Wover Mar 14 '21
This gives me a great idea:
const int MEGA_PI = 3141592;If you need more precision, just create a
GIGA_PIorTERA_PIconstant !