CARM User's Guide

Discontinued

sqrt

Summary
#include <math.h>

double sqrt (
  double x);  /* value to calculate square root of */
Description

The sqrt function calculates the square root of x.

Return Value

The sqrt function returns the positive square root of x.

  • If x < 0, sqrt returns NaN.
See Also

pow

Example
#include <math.h>
#include <stdio.h> /* for printf */

void tst_sqrt (void) {
  float x;
  float y;

  x = 25.0;
  y = sqrt (x); /* y = 5 */

  printf ("SQRT(%f) = %f\n", x, y);
}