Overview
TheSQRT() function returns the square root of a given positive number.
Syntax
The syntax for theSQRT() function in Oxla is:
SQRT() function requires one argument:
x: A positive number or an expression that evaluates to a positive number.
Examples
Case #1: SQRT() a Positive Value
The following example demonstrates how theSQRT() function can be used to find the square root of a positive integer:
Case #2: SQRT() With an Expression
Let’s look at an example of using theSQRT() function to find the square root of the result of an expression.
Case #3: SQRT() With Double Precision Result
In addition to integers, Oxla also supports calculating square roots with floating-point numbers as the outcome. For further details, please refer to the statement below:Case #4: SQRT() a Negative Number
The following example demonstrates how attempting to use theSQRT() function with a negative value will return an error:
SQRT() function only accepts positive numbers, you will get a NaN (Not a Number) result for the square root of -25, as shown below:
Case #5: SQRT Operator (|/(x))
Here’s an example using the SQRT operator (|/(x)) to calculate the square root of a given number: