Calculate the results with doubles. They have 15 significant digits. Your rquirementrequirement has a hard upperboundupper bound on c of 10^8 - itc of 108 — it can have at most 8 digits. Hence, the result will be precise if it's in range, and it will not overflow otherwise.
SamB
- 9.3k
- 5
- 51
- 57