Y0(3P)

πŸŽ€ Y0(3P) β€” bestie, it's Bessel time πŸŽ€

okay so real talk, this page lives in the POSIX Programmer's Manual, section 3P. That's the whole vibe. It's giving "standardized, official, slay."

⚠️ PROLOG moment β€” listen up: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so go consult the corresponding Linux manual page for the details of Linux behavior), or the interface might not even be implemented on Linux at all. ikr. check first, bestie πŸ’…

✨ NAME ✨

y0, y1, yn β€” Bessel functions of the second kind πŸ¦‹


🌸 SYNOPSIS 🌸

#include <math.h>

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

πŸ’– DESCRIPTION πŸ’–

So the y0(), y1(), and yn() functions shall compute Bessel functions of x of the second kind, of orders 0, 1, and n, respectively. That's it, that's the whole job. no cap.

Now, if your app wants to be a responsible little main character and actually check for error situations, here's the move: set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before you call these functions. Then on return, if errno is non-zero, or if fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero β€” boom, an error has occurred. 🚨


πŸ‘‘ RETURN VALUE πŸ‘‘

Upon successful completion, these functions shall return the relevant Bessel value of x of the second kind. iconic behavior.

  • If x is NaN, NaN shall be returned. 🫠
  • If the x argument to these functions is negative, -HUGE_VAL or NaN shall be returned, and a domain error may occur. 😭
  • If x is 0.0, -HUGE_VAL shall be returned and a pole error may occur. πŸ’€
  • If the correct result would cause underflow, 0.0 shall be returned and a range error may occur.
  • If the correct result would cause overflow, -HUGE_VAL or 0.0 shall be returned and a range error may occur.

πŸ”₯ ERRORS πŸ”₯

These functions may fail if... (drama incoming)

Domain Error

The value of x is negative.

If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM]. If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.

Pole Error

The value of x is zero.

If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE]. If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.

Range Error

The correct result would cause overflow.

If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE]. If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.

Range Error

The value of x is too large in magnitude, or the correct result would cause underflow.

If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE]. If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.

The following sections are informative. (i.e. the fun extras, not the rules-rules 🌈)

🌈 EXAMPLES 🌈

None. literally nothing. empty. a void. πŸ•³οΈ


🧚 APPLICATION USAGE 🧚

On error, the expressions (math_errhandling & MATH_ERRNO) and (math_errhandling & MATH_ERREXCEPT) are independent of each other β€” but at least one of them must be non-zero. so like, they don't text each other, but they both gotta show up. 🫢


πŸ’œ RATIONALE πŸ’œ

None. 😌


⭐ FUTURE DIRECTIONS ⭐

None. the future is... also nothing. periodt.


πŸ¦‹ SEE ALSO πŸ¦‹

  • feclearexcept()
  • fetestexcept()
  • isnan()
  • j0()

The Base Definitions volume of POSIX.1‐2017, Section 4.20, Treatment of Error Conditions for Mathematical Functions, <math.h> πŸ“š


Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


and that's the whole page, bestie πŸ’– brought to you by IEEE/The Open Group, dated 2017, and we're out πŸŽ€βœ¨ bye!!

πŸ“¦ where this page comes from