Core Function Floor

From Sputnik Wiki
Jump to: navigation, search
Floor( <expression> )

Contents

Description

Returns the largest integer less than or equal to the specified number.

Parameters

expression

Any valid numeric expression.

Return Value

Returns the rounded number.

Remarks

None.

Example

$msg = "";
$msg .= "Floor(4.8) = " . Floor(4.8) . @CR;
$msg .= "Floor(4.5) = " . Floor(4.5) . @CR;
$msg .= "Floor(4.3) = " . Floor(4.3) . @CR;
$msg .= "Floor(4) = " . Floor(4) . @CR;
$msg .= "Floor(-4.3) = " . Floor(-4.3) . @CR;
$msg .= "Floor(-4.5) = " . Floor(-4.5) . @CR;
$msg .= "Floor(-4.8) = " . Floor(-4.8) . @CR;
$msg .= "Floor(-4) = " . Floor(-4) . @CR;
 
MsgBox("Testing $msg");
// Output:
// Testing Floor(4.8) = 4
// Floor(4.5) = 4
// Floor(4.3) = 4
// Floor(4) = 4
// Floor(-4.3) = -5
// Floor(-4.5) = -5
// Floor(-4.8) = -5
// Floor(-4) = -4
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox