Try adding the value 0.999 to your test cases:

Oops!

You need to round t (either with the round() function or by adding 0.005) before converting it to a integral and fractional parts.

Even then there may be edge cases where conversion gives a wrong result. Floating point can be tricky! But it should be easy enough to iterate over all possible values of a double between about 0.005 and 9223372036854775000 (the maximum value of a double-precision number that fits in a signed 64-bit integer) to make sure they're all converted properly. There's only about 324259173170675712 values to check, so you could check them all in about 10 years, assuming you can check one billion values per second.