Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <math.h>
    double sqrt( double x );

Description:
    The sqrt function computes the non-negative square root of x.  A domain
    error occurs if the argument is negative.

Returns:
    The sqrt function returns the value of the square root.  When the
    argument is outside the permissible range, the  matherr function is
    called.  Unless the default  matherr function is replaced, it will set
    the global variable  errno to  EDOM, and print a "DOMAIN error"
    diagnostic message using the  stderr stream.

Example:
    #include <stdio.h>
    #include <math.h>

    void main()
      {
        printf( "%f\n", sqrt(.5) );
      }

    produces the following:

    0.707107

Classification:
    ANSI

Systems:
    Math

See Also:
    exp, log, pow, matherr

See Also: exp log

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson