math(3erl)
π NAME π
math β Mathematical functions. Yes bestie, that's the whole name, she's iconic like that. β¨
π¦ DESCRIPTION π¦
Okay so real talk: this module is basically a little doorway into a whole pile of mathematical functions. It provides an interface to a number of mathematical functions. That's it, that's the gig. π
π Note (read this one, fr fr)
Not all functions are provided on all platforms. In particular, the erf/1 and erfc/1 functions are not provided on Windows. So if you're on Windows and those two are giving "who is she" energy β that's why. π
β¨ EXPORTS β¨
Okay so this next bunch all share the same glow-up: they're a collection of mathematical functions that return floats, and the arguments are numbers. Every single one of them. No cap. π«Ά
acos(X) -> float()πacosh(X) -> float()πasin(X) -> float()πasinh(X) -> float()πatan(X) -> float()πatan2(Y, X) -> float()πatanh(X) -> float()πceil(X) -> float()πcos(X) -> float()πcosh(X) -> float()πexp(X) -> float()πfloor(X) -> float()πfmod(X, Y) -> float()πlog(X) -> float()πlog10(X) -> float()πlog2(X) -> float()πpow(X, Y) -> float()πsin(X) -> float()πsinh(X) -> float()πsqrt(X) -> float()πtan(X) -> float()πtanh(X) -> float()π
Types for the whole squad above:
Y = X = number()
A collection of mathematical functions that return floats. Arguments are numbers. Periodt. β¨
πΈ erf(X) -> float()
Types:
X = number()
Returns the error function of X, where:
erf(X) = 2/sqrt(pi)*integral from 0 to X of exp(-t*t) dt.
She's math. She's mysterious. Copy the formula exactly, bestie, don't improvise. π
π erfc(X) -> float()
Types:
X = number()
So erfc(X) returns 1.0 - erf(X), and the way it's computed uses methods that avoid cancellation for large X. Which is lowkey the whole point β big X energy handled gracefully. π
β pi() -> float()
A useful number. That's literally the documentation. A useful number. And honestly? She ate. π₯§
π LIMITATIONS π
As these are the C library, the same limitations apply. So whatever the C library is going through, we're going through it together. No extra promises, no cap. π«Ά
Quick vibe check π: every function up there returns afloat(), the args arenumber(), and the shared description applies to that whole big list β don't forget the Windows situation witherf/1anderfc/1. That's the tea. β
And that's the page, bestie! This whole thing is Ericsson AB's work β stdlib version 4.3.1.3, and it's the math page from the Erlang Module Definition set, aka math(3erl). Go be mathematically iconic. πβ¨π¦πΈπ
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms