Here's my rule of thumb for being on-topic:
Can this Question be resolved by reasoned mathematical argument?
Your post (on main Math.SE) ends with the following words:
So what am I doing wrong?
Do I need to store it as a float so that all the digits are right of the decimal point? Do I need a special library (like Brobdingnag in R) to handle ...