07-27-2022, 04:38 AM
Try putting in .01 or .301 and see what you get.
Also, and this one is much tougher: .333333333333333 (.3 taken to 15-digits. Multiply by 3 and you get .9 to 15-digits. Fine, Do that with 3 with 16-digits and it reports 1.0. The trick is to design an algorithm that holds repeating digits so 1 / 3 * 3 = 1 but .3333333333333333 * 3 = .9999999999999999.
Pete
Also, and this one is much tougher: .333333333333333 (.3 taken to 15-digits. Multiply by 3 and you get .9 to 15-digits. Fine, Do that with 3 with 16-digits and it reports 1.0. The trick is to design an algorithm that holds repeating digits so 1 / 3 * 3 = 1 but .3333333333333333 * 3 = .9999999999999999.
Pete