Casting to an int will truncate toward zero. floor() will truncate toward negative infinite. This will give you different values if bar were negative.
Casting to an int will truncate toward zero. floor() will truncate toward negative infinite. This will give you different values if bar were negative.