sqrt(3)
๐ sqrt(3) โ the square root girlies ๐
okay so bestie, this is the manual for sqrt(3), from the Library Functions Manual (that's the section 3 girlies, the library calls, we love them). she's literally the square root function and she's been carrying math since forever ๐ซถ
โจ NAME โจ
sqrt, sqrtf, sqrtl โ square root function
๐ LIBRARY ๐
Math library (libm, -lm)
not me reminding you to link with -lm because the linker WILL be dramatic about it ๐
๐ธ SYNOPSIS ๐ธ
#include <math.h>
double sqrt(double x);
float sqrtf(float x);
long double sqrtl(long double x);
๐ฆ Feature Test Macro Requirements for glibc ๐ฆ
(see feature_test_macros(7) for the whole lore)
sqrtf(), sqrtl():
_ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
|| /* Since glibc 2.19: */ _DEFAULT_SOURCE
|| /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
like yes queen, define one of those or she simply will not show up ๐
๐ DESCRIPTION ๐
These functions return the nonnegative square root of x. that's the vibe. positive root only, she does not do negative, we've talked about this ๐ญ
๐ฅ RETURN VALUE ๐ฅ
On success, these functions return the square root of x. iconic behavior honestly โจ
- If
xis a NaN, a NaN is returned. - If
xis+0(-0),+0(-0) is returned. - If
xis positive infinity, positive infinity is returned. - If
xis less than-0, a domain error occurs, and a NaN is returned. ๐จ
๐ญ ERRORS ๐ญ
See math_error(7) for information on how to determine whether an error has occurred when calling these functions. (iykyk)
The following errors can occur:
- Domain error:
xless than-0โerrnois set toEDOM. An invalid floating-point exception (FE_INVALID) is raised.
bestie you literally cannot sqrt a negative and get a real one, she said no thank u ๐๐
๐ ATTRIBUTES ๐
For an explanation of the terms used in this section, see attributes(7).
sqrt(),sqrtf(),sqrtl()โ Thread safety โ MT-Safe ๐
MT-Safe means she's safe to use from multiple threads at once, no drama, we stan a secure queen โจ
๐ STANDARDS ๐
C11, POSIX.1-2008.
๐ง HISTORY ๐ง
C99, POSIX.1-2001.
The variant returning double also conforms to SVr4, 4.3BSD, C89. she's been certified for a MINUTE, respect the elders ๐
โญ SEE ALSO โญ
okay that's the whole page bestie! this was the Linux man-pages 6.20 release, dated 2026-02-08, and the page is sqrt(3) โ go forth and take square roots responsibly, mwah ๐โจ๐
๐ฆ where this page comes from
- arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- ๐ the page's license: Linux-man-pages-copyleft
- Copyright 1993, David Metcalfe <david@prism.demon.co.uk>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms