FREXP(3P)

✨ FREXP(3P) β€” the POSIX girlie's guide ✨

okay so bestie, this is a page from the POSIX Programmer's Manual πŸ’– (yes, that POSIX, the one that's always in the group chat). Heads up tho: the Linux implementation of this interface may be different from what's written here β€” so if you're on Linux, go check the corresponding Linux manual page for the actual tea. Or… it might not even be implemented on Linux at all 😭 vibe check failed, sorry.


🌸 PROLOG 🌸

ok so real talk: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so pls consult the corresponding Linux manual page for the Linux behavior, bestie), or the interface might just… not be implemented on Linux at all. πŸ™ˆ


πŸ’… NAME πŸ’…

frexp, frexpf, frexpl β€” extract mantissa and exponent from a double precision number ✨ (it's giving "math girlie takes a number apart and shows you its bones", we love her)


πŸŽ€ SYNOPSIS πŸŽ€

#include <math.h>

double frexp(double num, int *exp);
float frexpf(float num, int *exp);
long double frexpl(long double num, int *exp);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the functionality described on this reference page is aligned with the ISO C standard. If there's any conflict between what's required here and what the ISO C standard says, that conflict is unintentional β€” not a girlboss move, just an oopsie. This volume of POSIX.1‐2017 defers to the ISO C standard, periodt.

These functions shall break a floating-point number num into a normalized fraction and an integral power of 2. The integer exponent shall be stored in the int object pointed to by exp. 🫢


πŸ”₯ RETURN VALUE πŸ”₯

For finite arguments, these functions shall return the value x, such that x has a magnitude in the interval [Β½,1) or 0, and num equals x times 2 raised to the power *exp. (yes that's a half-open interval, no she's not messy, she's precise πŸ’…)

  • If num is NaN, a NaN shall be returned, and the value of *exp is unspecified πŸ‘€ (we simply do not know her)
  • If num is Β±0, Β±0 shall be returned, and the value of *exp shall be 0
  • If num is Β±Inf, num shall be returned, and the value of *exp is unspecified 😭

πŸ’€ ERRORS πŸ’€

No errors are defined. Not a single one. She's flawless. ✨

The following sections are informative. (translation: the tea is optional but we're drinking it anyway πŸ“)


🌈 EXAMPLES 🌈

None. 😌 (iconic of her honestly)


πŸ’œ APPLICATION USAGE πŸ’œ

None. 🧚 (again, no notes)


⭐ RATIONALE ⭐

None. πŸ‘‘


🌸 FUTURE DIRECTIONS 🌸

None. (she's not going anywhere, she's eternal πŸ’–)


🫢 SEE ALSO 🫢

  • isnan()
  • ldexp()
  • modf()

The Base Definitions volume of POSIX.1‐2017, <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 (she's the main character, no cap). 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 .


ngl the only thing I edited was the vibe πŸ’… every single fact, flag, value and reference is exactly where it was. we do not gatekeep, we do not spread misinformation. periodt.

okay bye bestie, go forth and split those floating-point numbers πŸ’–βœ¨πŸ¦‹πŸŒΈπŸŽ€

β€” with love from the IEEE / The Open Group, 2017, page FREXP(3P) πŸ«ΆπŸ‘‘πŸŒˆ

πŸ“¦ where this page comes from