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 x is a NaN, a NaN is returned.
  • If x is +0 (-0), +0 (-0) is returned.
  • If x is positive infinity, positive infinity is returned.
  • If x is 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: x less than -0 โ€” errno is set to EDOM. 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 โญ

cbrt(3), csqrt(3), hypot(3)


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
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms