Floor

From WikiPrizm
Revision as of 21:44, 18 March 2013 by Flyingfish (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to 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