1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .\" References consulted:
8 .\" Linux libc source code
9 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
11 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
12 .\" Modified 2002-07-27 by Walter Harms
13 .\" (walter.harms@informatik.uni-oldenburg.de)
14 .TH SQRT 3 2021-03-22 "Linux man-pages (unreleased)" "Linux Programmer's Manual"
16 sqrt, sqrtf, sqrtl \- square root function
19 .RI ( libm ", " \-lm )
24 .BI "double sqrt(double " x );
25 .BI "float sqrtf(float " x );
26 .BI "long double sqrtl(long double " x );
30 Feature Test Macro Requirements for glibc (see
31 .BR feature_test_macros (7)):
37 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
38 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
39 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
42 These functions return the nonnegative square root of
45 On success, these functions return the square root of
50 is a NaN, a NaN is returned.
54 is +0 (\-0), +0 (\-0) is returned.
58 is positive infinity, positive infinity is returned.
63 a domain error occurs,
64 and a NaN is returned.
68 for information on how to determine whether an error has occurred
69 when calling these functions.
71 The following errors can occur:
73 Domain error: \fIx\fP less than \-0
77 An invalid floating-point exception
81 For an explanation of the terms used in this section, see
89 Interface Attribute Value
94 T} Thread safety MT-Safe
100 C99, POSIX.1-2001, POSIX.1-2008.
102 The variant returning