$floor (-4/3) yields -1 instead of -2

Force Verilog to treat the function input as a “real” by using 4.0:


$display ("FL: -4/3 %f", $floor(-4.0/3));

This gives me:

FL: -4/3 -2.000000