TANPI(3)

📦
version 15.1 · 2 versions
, in freebsd 15.1

🌸 NAME 🌸

okay so bestie, this is the tanpi(3) page from the Library Functions Manual, and the stars are tanpi, tanpif, and tanpil — the half–cycle tangent functions. iconic behavior, no cap. 💅

📚 LIBRARY 📚

They live in the Math Library (libm, link it with -lm). slay. ✨

🧾 SYNOPSIS 🧾

the include and signatures, verbatim:

#include <math.h>

double
tanpi(double x);

float
tanpif(float x);

long double
tanpil(long double x);

💖 DESCRIPTION 💖

okay so what do they actually do? The tanpi(), tanpif(), and tanpil() functions compute the tangent of π × x and measure angles in half–cycles. that's the whole main character energy right there. 🦋

🔥 RETURN VALUES 🔥

The tanpi(), tanpif(), and tanpil() functions return tan(π × x). If |x| ≥ 2^(p - 1) where p is the floating–point precision of x, then the returned value is ±0 and it has no significance. literally do not trust that little zero, bestie. 😭

⭐ SPECIAL VALUES ⭐

vibe check for tanpi specifically:

  • tanpi(±0) — returns ±0.
  • tanpi(±n) — returns ±0 for positive integers n.
  • tanpi(±n/2) — returns NaN for n > 0 and raises an FE_INVALID exception.
  • tanpi(±∞) — return an NaN and raises an FE_INVALID exception.
  • tanpi(NaN) — return an NaN and raises an FE_INVALID exception.

👀 SEE ALSO 👀

go read these too, iykyk:

🫶 AUTHORS 🫶

The half–cycle trignometric functions were written by Steven G. Kargl <kargl@FreeBSD.org>. 🫶

🌈 STANDARDS 🌈

These functions conform to , to ISO/IEC TS 18661-4, "Information technology — Programming languages, their environments, and system software interfaces — Floating–point extensions for C" — Part 4: Supplementary functions, and to .


mwah 💋 source/version: Debian; date: November 16, 2025; page: TANPI(3). byeee 🎀

📦 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