I assume that this occurs because d_dec is not exactly 3423781898 (i.e. its a minuscule amount less so it rounds it down). Does anyone know to solve this problem? I've tried a few things (e.g. using round()) but nothing seems to work.
floating point cannot exactly represent all possible values. in the commented values, the answer is 1. The result is 0.999999 something. The answer is effectively 1. Its correct, within the machine's ability to handle the values. You are up against the limits of what a double can handle. You can use something with more bits, but everything has limits and eventually you will hit them.