Share this page

# sqrt

Mathematics Functions

Computes the square root of x.

    double sqrt( double x);

x | A number.

## Return Values

The square root of the specified number.

## Example

The following example calculates the square root of various numbers using sqrt. Note that if x is negative, an indefinite result is returned.

Copy code

    // Explicit forward declaration
        double sqrt(double x);
        lr_output_message ("Square root of 9 = %f\n", sqrt(9));
        lr_output_message ("Square root of 8 = %f\n", sqrt(8));
        lr_output_message ("Square root of -8 = %f\n", sqrt(-8));

    Example: Output:
    Action.c(5): Square root of 9 = 3.000000
    Action.c(6): Square root of 8 = 2.828427
    Action.c(7): Square root of -8 = -1.#IND00

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: