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 5Input 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”). According to the general rules about data types, the operator can be applied also on sub-types of number, that is the type integer. The result has type number.
Examples
Given the operand dataset DS_1:
Input DS_1 (see structure)
Id_1 |
Id_2 |
Me_1 |
Me_2 |
|---|---|---|---|
10 |
A |
16 |
1.5625 |
10 |
B |
81 |
11.2225 |
11 |
A |
64 |
52.5625 |
Example 1
DS_r := sqrt(DS_1);
results in (see structure):
Id_1 |
Id_2 |
Me_1 |
Me_2 |
|---|---|---|---|
10 |
A |
4.0 |
1.25 |
10 |
B |
9.0 |
3.35 |
11 |
A |
8.0 |
7.25 |
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 |
1.5625 |
10 |
B |
9.0 |
11.2225 |
11 |
A |
8.0 |
52.5625 |