1Libm(3) User Contributed Perl Documentation Libm(3)
2
3
4
6 Math::Libm - Perl extension for the C math library, libm
7
9 use Math::Libm ':all';
10
11 print "e = ", M_E, "\n";
12 print "pi/2 = ", M_PI_2, "\n";
13 print "erf(1) = ", erf(1), "\n";
14 print "hypot(3,4) = ", hypot(3,4), "\n";
15
16 my $signgam = 0;
17 my $y = lgamma_r(-0.5, $signgam);
18 print "signgam=$signgam lgamma=$y\n";
19
21 This module is a translation of the C math.h file. It exports the
22 following selected constants and functions.
23
24 EXPORT
25 None by default.
26
27 Exportable constants
28 M_1_PI
29 M_2_PI
30 M_2_SQRTPI
31 M_E
32 M_LN10
33 M_LN2
34 M_LOG10E
35 M_LOG2E
36 M_PI
37 M_PI_2
38 M_PI_4
39 M_SQRT1_2
40 M_SQRT2
41
42 Exportable functions
43 double acos(double x)
44 double acosh(double x)
45 double asin(double x)
46 double asinh(double x)
47 double atan(double x)
48 double atanh(double x)
49 double cbrt(double x)
50 double ceil(double x)
51 double cosh(double x)
52 double erf(double x)
53 double erfc(double x)
54 double expm1(double x)
55 double floor(double x)
56 double hypot(double x, double y)
57 double j0(double x)
58 double j1(double x)
59 double jn(int n, double x)
60 double lgamma_r(double x, int signgam)
61 double log10(double x)
62 double log1p(double x)
63 double pow(double x, double y)
64 double rint(double x)
65 double sinh(double x)
66 double tan(double x)
67 double tanh(double x)
68 double y0(double x)
69 double y1(double x)
70 double yn(int n, double x)
71
73 Daniel S. Lewart, <d-lewart@uiuc.edu>
74
76 perlfunc, Math::Complex, POSIX.
77
79 Only tested on AIX 4.2, FreeBSD 4.0, Linux 2.2.16, and Solaris 2.5.1.
80 May need some more functions.
81
82
83
84perl v5.30.1 2020-01-30 Libm(3)