Floor

From WikiPrizm
Jump to: navigation, search

Synopsis

Round a number downwards to the nearest integer.

Definition

float floor(x) {
    return ((int)x) - (x < 0);
}


Inputs

x - number to be rounded down.

Outputs

Returns rounded number.

Credits

Tari