j0(3)

✨ j0(3) β€” bestie edition ✨

okay so this is from the Library Functions Manual (that's the manual name btw, in case you were wondering) and it's all about Bessel functions of the first kind. stick with me, it's giving math but make it cute πŸ’…


🌸 NAME 🌸

j0, j0f, j0l, j1, j1f, j1l, jn, jnf, jnl β€” Bessel functions of the first kind


πŸ‘‘ LIBRARY πŸ‘‘

Math library (libm, link it with -lm bestie, don't forget the -lm)


πŸ’– SYNOPSIS πŸ’–

so here's the tea, you gotta include the header first:

#include <math.h>

then the double girlies:

double j0(double x);
double j1(double x);
double jn(int n, double x);

the float versions (yes they get the f suffix, iconic):

float j0f(float x);
float j1f(float x);
float jnf(int n, float x);

and the long double ones with the lil l:

long double j0l(long double x);
long double j1l(long double x);
long double jnl(int n, long double x);

🌈 Feature Test Macro Requirements for glibc 🌈

(and if you don't know what that means, go read feature_test_macros(7), no cap)

j0(), j1(), jn():

_XOPEN_SOURCE
    || /* Since glibc 2.19: */ _DEFAULT_SOURCE
    || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE

j0f(), j0l(), j1f(), j1l(), jnf(), jnl():

_XOPEN_SOURCE >= 600
    || (_ISOC99_SOURCE && _XOPEN_SOURCE)
    || /* Since glibc 2.19: */ _DEFAULT_SOURCE
    || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE

like. write that down. πŸ“


πŸŽ€ DESCRIPTION πŸŽ€

okay so the actual lore:

  • j0() and j1() return Bessel functions of x of the first kind, of orders 0 and 1, respectively. so j0 is order zero, j1 is order one. cute, matching numbers.
  • jn() returns the Bessel function of x of the first kind of order n. you pick the order, she delivers.

and then the type side-quests:

  • j0f(), j1f(), and jnf() are the versions that take and return float values.
  • j0l(), j1l(), and jnl() are the versions that take and return long double values.

same vibes, different precision. slay. ✨


πŸ’… RETURN VALUE πŸ’…

  • On success, these functions return the appropriate Bessel value of the first kind for x. 🫢
  • If x is a NaN, a NaN is returned. (garbage in, garbage out, but make it IEEE 754)
  • If x is too large in magnitude, or the result underflows, a range error occurs, and the return value is 0.
⚠️ underflow or humongous x = range error + you get a 0 back. know that. πŸ’€

πŸ”₯ ERRORS πŸ”₯

wanna know if an error actually happened when you called these? go read math_error(7), she explains the whole ✨how to detect✨ thing.

The following errors can occur:

  • Range error: result underflow, or x is too large in magnitude β€” errno is set to ERANGE.

and also, important, no drama on the exception front:

These functions do not raise exceptions for fetestexcept(3).

ngl that's a whole mood. πŸ™ˆ


⭐ ATTRIBUTES ⭐

for what all these words even mean, attributes(7) has you covered bestie. here's the rundown (yes it was a table, i turned it into bullets, you're welcome):

  • j0(), j0f(), j0l() β€” Attribute: Thread safety β€” Value: MT-Safe
  • j1(), j1f(), j1l() β€” Attribute: Thread safety β€” Value: MT-Safe
  • jn(), jnf(), jnl() β€” Attribute: Thread safety β€” Value: MT-Safe

all MT-Safe, all the time. multithreading girlies we are FED. πŸ“


🌈 STANDARDS 🌈

  • j0()
  • j1()
  • jn()

POSIX.1-2008.

Others:

  • BSD.

πŸ¦‹ HISTORY πŸ¦‹

  • j0()
  • j1()
  • jn()

SVr4, 4.3BSD, POSIX.1-2001, POSIX.1-2008.

Others:

  • BSD.

she's been around. veteran behavior. πŸ‘‘


πŸ’€ BUGS πŸ’€

okay this is the part where we hold hands:

There are errors of up to 2e-16 in the values returned by j0(), j1(), and jn() for values of x between -8 and 8.

so like. tiny imprecision. 2e-16. real. not a drill. 😭


🫢 SEE ALSO 🫢

(her sibling. the other kind. iykyk)


and that's the whole page bestie!! πŸ’– this one came from Linux man-pages 6.20, dated 2026-02-08, so you know it's fresh. go forth and compute your Bessel functions, you absolute main character βœ¨πŸŽ€πŸ¦‹

πŸ“¦ 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