View other versions (4)
Contents

The sqrt function returns the nonnegative square root of x. Mar 05, 2012  I want to check code inside math library function sqrt how is it possible? I am using DEV C.

Cannot open c dev opengl debug opengl.exe for writing opengl. What are the generic rules?Let’s say you’re the author of GLFW.


Description

The sqrt function computes the non-negative square root of x, i.esqrt(x)For complex numbers x, sqrt returns the complex root of x, using the following formulawhere is the argument of x.
Example - Square root function
Ouput:

Special Values

Dev c math.h sqrt 5sqrt ( -0 ) returns -0.sqrt ( xMath.h ) returns a NaN and generates a domain error for x < 0.

Standards

The sqrt function conforms to ISO/IEC 9899:1999(E).

Compatibility

DOSUNIXWindowsANSI CC++ only
sqrtl••
Real sqrt••••
Complex sqrt•••
Complex csqrt••
math.h
/* math.h
Definitions for the math floating point package.
Copyright (c) 1987, 1992 by Borland International
All Rights Reserved.
*/
#ifndef __MATH_H
#define__MATH_H
#if !defined(___DEFS_H)
#include<_defs.h>
#endif
#defineHUGE_VAL _huge_dble
externdouble _Cdecl _huge_dble;
#define_LHUGE_VAL _huge_ldble
externlongdouble _Cdecl _huge_ldble;
#ifdef __cplusplus
extern'C' {
#endif
double _Cdecl _FARFUNC acos (double __x);
double _Cdecl _FARFUNC asin (double __x);
double _Cdecl atan (double __x);
double _Cdecl _FARFUNC atan2 (double __y, double __x);
double _Cdecl _FARFUNC ceil (double __x);
double _Cdecl _FARFUNC cos (double __x);
double _Cdecl _FARFUNC cosh (double __x);
double _Cdecl _FARFUNC exp (double __x);
double _Cdecl fabs (double __x);
double _Cdecl __fabs__ (double __x); /* Intrinsic */
double _Cdecl _FARFUNC floor (double __x);
double _Cdecl _FARFUNC fmod (double __x, double __y);
double _Cdecl _FARFUNC frexp (double __x, int _FAR *__exponent);
double _Cdecl _FARFUNC ldexp (double __x, int __exponent);
double _Cdecl _FARFUNC log (double __x);
double _Cdecl _FARFUNC log10 (double __x);
double _Cdecl _FARFUNC modf (double __x, double _FAR *__ipart);
double _Cdecl _FARFUNC pow (double __x, double __y);
double _Cdecl _FARFUNC sin (double __x);
double _Cdecl _FARFUNC sinh (double __x);
double _Cdecl _FARFUNC sqrt (double __x);
double _Cdecl _FARFUNC tan (double __x);
double _Cdecl _FARFUNC tanh (double __x);
longdouble _Cdecl _FARFUNC acosl (longdouble __x);
longdouble _Cdecl _FARFUNC asinl (longdouble __x);
longdouble _Cdecl _FARFUNC atan2l (longdouble __x, longdouble __y);
longdouble _Cdecl atanl (longdouble __x);
longdouble _Cdecl _FARFUNC ceill (longdouble __x);
longdouble _Cdecl _FARFUNC coshl (longdouble __x);
longdouble _Cdecl _FARFUNC cosl (longdouble __x);
longdouble _Cdecl _FARFUNC expl (longdouble __x);
longdouble _Cdecl fabsl (longdouble __x);
longdouble _Cdecl _FARFUNC floorl (longdouble __x);
longdouble _Cdecl _FARFUNC fmodl (longdouble __x, longdouble __y);
longdouble _Cdecl _FARFUNC frexpl (longdouble __x, int _FAR *__exponent);
longdouble _Cdecl _FARFUNC ldexpl (longdouble __x, int __exponent);
longdouble _Cdecl _FARFUNC log10l (longdouble __x);
longdouble _Cdecl _FARFUNC logl (longdouble __x);
longdouble _Cdecl _FARFUNC modfl (longdouble __x, longdouble _FAR *__ipart);
longdouble _Cdecl _FARFUNC powl (longdouble __x, longdouble __y);
longdouble _Cdecl _FARFUNC sinhl (longdouble __x);
longdouble _Cdecl _FARFUNC sinl (longdouble __x);
longdouble _Cdecl _FARFUNC sqrtl (longdouble __x);
longdouble _Cdecl _FARFUNC tanhl (longdouble __x);
longdouble _Cdecl _FARFUNC tanl (longdouble __x);
typedefenum
{
DOMAIN = 1, /* argument domain error -- log (-1) */
SING, /* argument singularity -- pow (0,-2)) */
OVERFLOW, /* overflow range error -- exp (1000) */
UNDERFLOW, /* underflow range error -- exp (-1000) */
TLOSS, /* total loss of significance -- sin(10e70) */
PLOSS, /* partial loss of signif. -- not used */
STACKFAULT /* floating point unit stack overflow */
} _mexcep;
#ifdef __cplusplus
}
#endif
#if !__STDC__
struct exception
{
int type;
char _FAR *name;
double arg1, arg2, retval;
};
struct _exceptionl
{
int type;
char _FAR *name;
longdouble arg1, arg2, retval;
};
#ifdef __cplusplus
extern'C' {
#endif
int _Cdecl abs (int __x);
double _Cdecl atof (constchar _FAR *__s);
double _Cdecl _FARFUNC hypot (double __x, double __y);
long _Cdecl labs (long __x);
int _Cdecl _FARFUNC matherr (struct exception _FAR *__e);
double _Cdecl _FARFUNC poly (double __x, int __degree, double _FAR *__coeffs);
double _Cdecl _FARFUNC pow10 (int __p);
int _Cdecl _FARFUNC _matherrl (struct _exceptionl _FAR *__e);
longdouble _Cdecl _atold (constchar _FAR *__s);
longdouble _Cdecl _FARFUNC hypotl (longdouble __x, longdouble __y);
longdouble _Cdecl _FARFUNC polyl (longdouble __x, int __degree, longdouble _FAR *__coeffs);
longdouble _Cdecl _FARFUNC pow10l (int __p);
#ifdef __cplusplus
/* use class complex instead of cabs in C++ */
#else
struct complex /* as used by 'cabs' function */
{
double x, y;
};
struct _complexl /* as used by 'cabsl' function */
{
longdouble x, y;
};
#definecabs(z) (hypot ((z).x, (z).y))
#definecabsl(z) (hypotl ((z).x, (z).y))
#endif
#ifdef __cplusplus
}
#endif
/* Constants rounded for 21 decimals. */
#defineM_E2.71828182845904523536
#defineM_LOG2E1.44269504088896340736
#defineM_LOG10E0.434294481903251827651
#defineM_LN20.693147180559945309417
#defineM_LN102.30258509299404568402
#defineM_PI3.14159265358979323846
#defineM_PI_21.57079632679489661923
#defineM_PI_40.785398163397448309616
#defineM_1_PI0.318309886183790671538
#defineM_2_PI0.636619772367581343076
#defineM_1_SQRTPI0.564189583547756286948
#defineM_2_SQRTPI1.12837916709551257390
#defineM_SQRT21.41421356237309504880
#defineM_SQRT_20.707106781186547524401
#defineEDOM33/* Math argument */
#defineERANGE34/* Result too large */
#endif /* !__STDC__ */
#endif

Dev C Math.h Sqrt 10

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment