Square root: sqrt
Syntax
sqrt ( op )
Input parameters
op |
the operand |
Examples of valid syntaxes
sqrt ( DS_1 )
sqrt ( 5 )
Semantics for scalar operations
The operator sqrt calculates the square root of a number. For example:
sqrt ( 25 )
gives 5
Input parameters type
op
dataset { measure<number [value >= 0] > _+ }
| component<number [value >= 0] >
| number [value >= 0]
Result type
result
dataset { measure<number [value >= 0] > _+ }
| component<number [value >= 0] >
| number [value >= 0]
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”). Some valid examples could be: sqrt ( DS_1 ), sqrt ( 5 ).
Examples
Given the operand dataset DS_1:
Input DS_1 (see structure)
Id_1 |
Id_2 |
Me_1 |
Me_2 |
---|---|---|---|
10 |
A |
16 |
0.7545 |
10 |
B |
81 |
13.45 |
11 |
A |
64 |
1.87 |
Example 1
DS_r := sqrt(DS_1);
results in (see structure):
Id_1 |
Id_2 |
Me_1 |
Me_2 |
---|---|---|---|
10 |
A |
4.0 |
0.86862 |
10 |
B |
9.0 |
3.667424 |
11 |
A |
8.0 |
1.367479 |
Example 2
DS_r := DS_1 [ calc Me_1 := sqrt ( Me_1 ) ];
results in (see structure):
Id_1 |
Id_2 |
Me_1 |
Me_2 |
---|---|---|---|
10 |
A |
4.0 |
0.7545 |
10 |
B |
9.0 |
13.45 |
11 |
A |
8.0 |
1.87 |