This looks strange, but it's not a bug. That is how floating point numbers work. When you floor a positive number, it goes to the closest integer that is smaller. But if you floor a negative number, then it also goes to the next smallest integer, which is another negative number but with a larger magnitude. So look at this:
print(floor(3.14))
print(floor(-3.14))
Which prints:
3
-4
That is normal and to the IEEE standard. But if you do this:
print(floor(0.0001))
print(floor(-0.0001))
You get:
0
-1
To understand these results, you have to understand how floating-point precision works. A floating point number on a computer cannot represent any arbitrary value, there is a limit to the precision, and the number you set a variable to will almost never be exact. So you may believe that you have set a variable to "3.14" but in actuality to a computer it is really "3.140001" or something like that. And once you do anything to that number, like addition or multiplication, then it is more likely to be off from what you originally set. The difference will be small, and not noticeable for any general calculation, but can cause problems if you don't understand what is happening.
So in this case, the number you think is -0 is not actually -0 but some number ever slightly smaller than -0 like -0.0000000001 or whatever, which will correctly evaluate to -1 if you call floor(). So you have to take this into consideration when working with floats and adjust your logic to account for the inaccuracy.