1. C# Sqrt Function
  2. Dev C Sqrt Function Examples

Std::sqrt is required by the IEEE standard to be exact. The only other operations required to be exact are the arithmetic operators and the function std::fma. After rounding to the return type (using default rounding mode), the result of std::sqrt. C pow The pow function computes a base number raised to the power of exponent number. This function is defined in header file. Pow Prototype As of C 11 standard Since C.

In the C Programming Language, the sqrt function returns the square root of x.

Syntax

The syntax for the sqrt function in the C Language is:

C# Sqrt Function

Parameters or Arguments

x
A value used when calculating the square root of x.

Returns

The sqrt function returns the square root of x. If x is negative, the sqrt function will return a domain error.

Required Header

In the C Language, the required header for the sqrt function is:

Applies To

In the C Language, the sqrt function can be used in the following versions: /auto-tune-80-free.html.

  • ANSI/ISO 9899-1990

sqrt Example

When compiled and run, this application will output:

Similar Functions

Other C functions that are similar to the sqrt function:

-->

Calculates the square root.

Syntax

Parameters

x
Non-negative floating-point value

Remarks

Because C++ allows overloading, you can call overloads of sqrt that take float or longdouble types. In a C program, sqrt always takes and returns double.

By default, this function's global state is scoped to the application. To change this, see Global state in the CRT.

Return Value

The sqrt functions return the square-root of x. By default, if x is negative, sqrt returns an indefinite NaN.

InputSEH Exception_matherr Exception
± QNAN,INDnone_DOMAIN
- ∞none_DOMAIN
x<0none_DOMAIN

Requirements

FunctionC headerC++ header
sqrt, sqrtf, sqrtl<math.h><cmath>

For compatibility information, see Compatibility.

Example

See also

Dev C Sqrt Function Examples

Floating-Point Support
exp, expf, expl
log, logf, log10, log10f
pow, powf, powl
_CIsqrt