y0(3)

๐Ÿ’– NAME ๐Ÿ’–

y0, y0f, y0l, y1, y1f, y1l, yn, ynf, ynl โ€” Bessel functions of the second kind, bestie. yes we're doing special functions today, get comfy ๐Ÿซถ

๐Ÿ“š LIBRARY ๐Ÿ“š

Math library (libm, -lm). so like. you will be linking -lm. it's giving "forgot the flag, spent an hour confused" energy, don't be that girl ๐Ÿ’…


โœจ SYNOPSIS โœจ

#include <math.h>

double y0(double x);
double y1(double x);
double yn(int n, double x);

float y0f(float x);
float y1f(float x);
float ynf(int n, float x);

long double y0l(long double x);
long double y1l(long double x);
long double ynl(int n, long double x);

๐Ÿงš Feature Test Macro Requirements for glibc (see feature_test_macros(7)):

y0(), y1(), yn():
    _XOPEN_SOURCE
        || /* Since glibc 2.19: */ _DEFAULT_SOURCE
        || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE

y0f(), y0l(), y1f(), y1l(), ynf(), ynl():
    _XOPEN_SOURCE >= 600
        || (_ISOC99_SOURCE && _XOPEN_SOURCE)
        || /* Since glibc 2.19: */ _DEFAULT_SOURCE
        || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
okay so the /* Since glibc 2.19: */ and /* glibc <= 2.19: */ bits are load-bearing โ€” they tell you which glibc era each alternative applies to. do not delete them, they're not decoration ๐ŸŽ€

๐ŸŒธ DESCRIPTION ๐ŸŒธ

so here's the tea โ˜•:

  • y0() and y1() hand you back Bessel functions of x of the second kind, of orders 0 and 1 respectively.
  • yn() hands you back the Bessel function of x of the second kind of order n.

The value of x must be positive. that's not a suggestion, that's a requirement, periodt โœ‹

The y0f(), y1f(), and ynf() gals are the versions that take and return float values. The y0l(), y1l(), and ynl() versions take and return long double values. same vibes, bigger/smaller pants ๐Ÿ’œ


๐Ÿ”ฎ RETURN VALUE ๐Ÿ”ฎ

On success, these functions return the appropriate Bessel value of the second kind for x. slay โœจ

  • If x is a NaN, a NaN is returned. (garbage in, garbage out, iconic behaviour)
  • If x is negative, a domain error occurs, and the functions return -HUGE_VAL, -HUGE_VALF, or -HUGE_VALL, respectively. (POSIX.1-2001 also allows a NaN return for this case.)
  • If x is 0.0, a pole error occurs, and the functions return -HUGE_VAL, -HUGE_VALF, or -HUGE_VALL, respectively. ๐Ÿ’€
  • If the result underflows, a range error occurs, and the functions return 0.0
  • If the result overflows, a range error occurs, and the functions return -HUGE_VAL, -HUGE_VALF, or -HUGE_VALL, respectively. (POSIX.1-2001 also allows a 0.0 return for this case.)

๐Ÿšจ 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 is negative โ€” errno is set to EDOM. An invalid floating-point exception (FE_INVALID) is raised.
  • Pole error: x is 0.0 โ€” errno is set to ERANGE and an FE_DIVBYZERO exception is raised (but see BUGS). ๐Ÿ‘€
  • Range error: result underflow โ€” errno is set to ERANGE. No FE_UNDERFLOW exception is returned by fetestexcept(3) for this case.
  • Range error: result overflow โ€” errno is set to ERANGE (but see BUGS). An overflow floating-point exception (FE_OVERFLOW) is raised.

๐Ÿ‘‘ ATTRIBUTES ๐Ÿ‘‘

For an explanation of the terms used in this section, see attributes(7). (the girls that know, know)

  • y0(), y0f(), y0l() โ€” Attribute: Thread safety โ€” Value: MT-Safe
  • y1(), y1f(), y1l() โ€” Attribute: Thread safety โ€” Value: MT-Safe
  • yn(), ynf(), ynl() โ€” Attribute: Thread safety โ€” Value: MT-Safe

all of them MT-Safe, every single one, no exceptions, main character energy ๐ŸŒˆ


๐Ÿ“œ STANDARDS ๐Ÿ“œ

  • y0()
  • y1()
  • yn() โ€” POSIX.1-2008.

Others: BSD.


๐Ÿฆ‹ HISTORY ๐Ÿฆ‹

  • y0()
  • y1()
  • yn() โ€” SVr4, 4.3BSD, POSIX.1-2001.

Others: BSD.

(the Others being the f and l variants, and yes they're BSD-flavoured ๐Ÿ“)


๐Ÿ’€ BUGS ๐Ÿ’€

bestie sit down, we gotta talk about the old days:

  • Before glibc 2.19, these functions misdiagnosed pole errors: errno was set to EDOM, instead of ERANGE and no FE_DIVBYZERO exception was raised. not the vibe ๐Ÿ˜ญ
  • Before glibc 2.17, did not set errno for "range error: result underflow".
  • In glibc 2.3.2 and earlier, these functions do not raise an invalid floating-point exception (FE_INVALID) when a domain error occurs.

๐Ÿซถ SEE ALSO ๐Ÿซถ


and that's the whole page, angel ๐Ÿ’– this one's from Linux man-pages 6.20, dated 2026-02-08 โ€” go forth and Bessel responsibly, ily, bye ๐ŸŽ€โœจ

๐Ÿ“ฆ 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