IEEE_TEST(3)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

✨ IEEE_TEST(3) ✨

okay so this is a page from the Library Functions Manual and it's literally called IEEE_TEST β€” yes bestie, the whole manual, and it lives in section 3 πŸ’…


πŸŽ€ NAME πŸŽ€

scalb, scalbf, significand, significandf β€” the IEEE test functions 🌸


πŸ“š LIBRARY πŸ“š

Math Library (libm, -lm) β€” so you're gonna want that -lm on your link line, no cap 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <math.h>

double
scalb(double x, double n);

float
scalbf(float x, float n);

double
significand(double x);

float
significandf(float x);

πŸ’– DESCRIPTION πŸ’–

okay so these functions exist for exactly one reason: they let you test conformance to IEEE Std 754-1985. that's it. that's the whole gig. the manual is very clear that "their use is not otherwise recommended" β€” like, it's giving diagnostic tool only, not main character energy πŸ™ˆ

scalb(x, n) and scalbf(x, n) return xβˆ—(2n), and the way they do it is by pure **exponent manipulation. so cute, so efficient ✨

⚠️ but listen β€” if n is not an integer, or if it's ±∞, or if it's a NaN, then the result is unspecified. not undefined-in-a-fun-way, unspecified-in-a-please-don't-do-this-way. you've been warned, bestie πŸ’€

significand(x) and significandf(x) return sig, where:

x := sig βˆ— 2**n

and sig sits in the range 1 ≀ sig < 2. adorable. very normalized. very slay πŸ‘‘

🚨 BUT β€” significand(x) and significandf(x) are not defined when x is 0, ±∞, or NaN. like, don't. just don't. 😭

πŸ”₯ SEE ALSO πŸ”₯

the girlies to check out next, fr fr 🧚


⭐ STANDARDS ⭐

IEEE Std 754-1985 β€” the blueprint, the origin story, the moment πŸ‘‘


that's the whole page, bestie!! this one came from Debian and it's dated November 6, 2005 β€” vintage, honestly πŸŽ€ go test your IEEE conformance and stay hydrated πŸ’œβœ¨

πŸ“¦ where this page comes from
  • freebsd 15.1: base 15.1
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms