SQRT
The number's square root: the non-negative value that, squared, gives it.
Group: Math. Compatible with DAX.
Syntax
SQRT ( <number> )
| Parameter | Type | Description |
|---|---|---|
number | Number | A number of 0 or more. |
Returns
Number. The square root: the number of 0 or more that, multiplied by itself, gives the number.
Remarks
- A negative number is an error. A blank gives BLANK.
SQRT ( x )isPOWER ( x, 0.5 ).- Square roots are rarely exact in floating point:
SQRT ( 2 ) * SQRT ( 2 ) = 2is FALSE. Round before comparing.
Examples
Square roots
EVALUATE
ROW (
"Of 16", SQRT ( 16 ),
"Of 2", SQRT ( 2 ),
"Of blank", SQRT ( BLANK () )
)
| Of 16 | Of 2 | Of blank |
|---|---|---|
| 4 | 1.4142135623731 | (blank) |
Compare after rounding
EVALUATE
ROW (
"As it is", SQRT ( 2 ) * SQRT ( 2 ) = 2,
"Rounded", ROUND ( SQRT ( 2 ) * SQRT ( 2 ), 10 ) = 2
)
| As it is | Rounded |
|---|---|
| FALSE | TRUE |