Floor: floor
Syntax
floor ( op )
Input parameters
op |
the operand |
Examples of valid syntaxes
floor ( DS_1 )
floor ( 3.14159 )
Semantics for scalar operations
The operator floor returns the greatest integer which is smaller than or equal to op. For example:
floor( 3.1415 )
gives 3
floor( 15 )
gives 15
floor( -3.1415 )
gives -4
floor( -0.1415 )
gives -1
Input parameters type
op
dataset { measure<number> _+ }
| component<number>
| number
Result type
result
dataset { measure<integer> _+ }
| component<integer>
| integer
Additional Constraints
None.
Behaviour
The operator has the behaviour of the “Operators applicable on one Scalar Value or Data Set or Data Set Component” (see the section “Typical behaviours of the ML Operators”).
Examples
Given the operand dataset DS_1:
Input DS_1 (see structure)
Id_1 |
Id_2 |
Me_1 |
Me_2 |
---|---|---|---|
10 |
A |
7.0 |
5.9 |
10 |
B |
0.1 |
-5.0 |
11 |
A |
-32.2 |
17.7 |
11 |
B |
44.5 |
-0.3 |
Example 1
DS_r := floor ( DS_1 );
results in (see structure):
Id_1 |
Id_2 |
Me_1 |
Me_2 |
---|---|---|---|
10 |
A |
7 |
5 |
10 |
B |
0 |
-5 |
11 |
A |
-33 |
17 |
11 |
B |
44 |
-1 |
Example 2
DS_r := DS_1 [ calc Me_10 := floor (Me_1) ];
results in (see structure):
Id_1 |
Id_2 |
Me_1 |
Me_2 |
Me_10 |
---|---|---|---|---|
10 |
A |
7.0 |
5.9 |
7 |
10 |
B |
0.1 |
-5.0 |
0 |
11 |
A |
-32.2 |
17.7 |
-33 |
11 |
B |
44.5 |
-0.3 |
44 |