Libm(3pm)
π NAME π
Math::Libm β a Perl extension for the C math library, libm. bestie. it's literally the C math library but it speaks Perl now π§β¨
πΈ SYNOPSIS πΈ
okay so here's the vibe, no cap:
use Math::Libm ':all';
print "e = ", M_E, "\n";
print "pi/2 = ", M_PI_2, "\n";
print "erf(1) = ", erf(1), "\n";
print "hypot(3,4) = ", hypot(3,4), "\n";
my $signgam = 0;
my $y = lgamma_r(-0.5, $signgam);
print "signgam=$signgam lgamma=$y\n";
likeβ¦ it's giving math. it's giving so much math. π
β¨ DESCRIPTION β¨
This module is a translation of the C math.h file. periodt. it exports the following selected constants and functions β and yes, selected is doing a lot of heavy lifting there, we'll get to that in BUGS bestie π
π EXPORT π
None by default. she's shy. you gotta ask for what you want (or hit her with :all) π«Ά
π¦ Exportable constants π¦
these little icons are just sitting there waiting for you, fr fr:
M_1_PI
M_2_PI
M_2_SQRTPI
M_E
M_LN10
M_LN2
M_LOG10E
M_LOG2E
M_PI
M_PI_2
M_PI_4
M_SQRT1_2
M_SQRT2
M_E, M_PI, and their whole entourage. iconic behavior honestly π
π Exportable functions π
here's the full lineup, exactly as written, no edits bestie:
double acos(double x)
double acosh(double x)
double asin(double x)
double asinh(double x)
double atan(double x)
double atanh(double x)
double cbrt(double x)
double ceil(double x)
double cosh(double x)
double erf(double x)
double erfc(double x)
double expm1(double x)
double floor(double x)
double hypot(double x, double y)
double j0(double x)
double j1(double x)
double jn(int n, double x)
double lgamma_r(double x, int signgam)
double log10(double x)
double log1p(double x)
double pow(double x, double y)
double rint(double x)
double sinh(double x)
double tan(double x)
double tanh(double x)
double y0(double x)
double y1(double x)
double yn(int n, double x)
the way that lgamma_r takes that int signgam and writes back to it β main character energy for real πβ¨ and the Bessel kids (j0, j1, jn, y0, y1, yn) showed up too, obsessed π
π AUTHOR π
Daniel S. Lewart, <d-lewart@uiuc.edu>. thank you king, we love a legend π
π₯ SEE ALSO π₯
perlfuncMath::ComplexPOSIX
the friend group π go say hi.
π BUGS π
Only tested on AIX 4.2, FreeBSD 4.0, Linux 2.2.16, and Solaris 2.5.1. May need some more functions.
yeah so. it's been tested on literally those four and nowhere else, bestie π and it may need some more functions β she's aware, she's working on herself, be nice π«Ά
so that's Math::Libm, from perl v5.42.3, dated 2026-08-19. iykyk. go do some math, slay, and remember: :all or you get NOTHING π
β¨π¦
π¦ where this page comes from
- ubuntu stonking: libmath-libm-perl 1.0-2build6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms