Floor

From WikiPrizm
Revision as of 12:16, 18 March 2013 by Flyingfish (talk | contribs) (Created page with "== Synopsis == Round a number downwards to the nearest integer. === Definition === <nowiki>float floor(x) { return ((int)x) - (x < 0); }</nowiki> === Inputs === '''x''...")
(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