Difference between revisions of "Floor"

From WikiPrizm
Jump to navigationJump to search
(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''...")
(No difference)

Revision as of 12:16, 18 March 2013

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