Using 'floor' for +ve floats

BlitzMax Forums/BlitzMax Beginners Area/Using 'floor' for +ve floats

JBR(Posted 2010) [#1]
Hi,

Just noticed that for +ve floats, you can use Int() to get the same value.

Int(5.1) gives 5
int(5.9) gives 5 also.

This is different to Int() in B3D.

Int() is also a good bit faster then Floor().

Jim


Czar Flavius(Posted 2010) [#2]
Just noticed that for +ve floats

To clarify for others, Floor and Int don't work the same on negative numbers (round down and up respectively)


Floyd(Posted 2010) [#3]
Floor(x) is a floating point value and means "x rounded toward negative infinity".

Int(x) is an integer, "x with everything after the decimal point deleted".