2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
4 .\" <mtk.manpages@gmail.com>
6 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
8 .\" References consulted:
9 .\" Linux libc source code
10 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
12 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
13 .\" Modified 2002-07-27 by Walter Harms
14 .\" (walter.harms@informatik.uni-oldenburg.de)
15 .TH sqrt 3 (date) "Linux man-pages (unreleased)"
17 sqrt, sqrtf, sqrtl \- square root function
20 .RI ( libm ", " \-lm )
25 .BI "double sqrt(double " x );
26 .BI "float sqrtf(float " x );
27 .BI "long double sqrtl(long double " x );
31 Feature Test Macro Requirements for glibc (see
32 .BR feature_test_macros (7)):
38 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
39 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
40 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
43 These functions return the nonnegative square root of
46 On success, these functions return the square root of
51 is a NaN, a NaN is returned.
55 is +0 (\-0), +0 (\-0) is returned.
59 is positive infinity, positive infinity is returned.
64 a domain error occurs,
65 and a NaN is returned.
69 for information on how to determine whether an error has occurred
70 when calling these functions.
72 The following errors can occur:
74 Domain error: \fIx\fP less than \-0
78 An invalid floating-point exception
82 For an explanation of the terms used in this section, see
90 Interface Attribute Value
95 T} Thread safety MT-Safe
105 The variant returning