New modules for common <math.h> functions.
authorBruno Haible <bruno@clisp.org>
Tue, 19 Jan 2010 00:40:52 +0000 (01:40 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 19 Jan 2010 00:43:27 +0000 (01:43 +0100)
74 files changed:
ChangeLog
doc/posix-functions/acos.texi
doc/posix-functions/asin.texi
doc/posix-functions/atan.texi
doc/posix-functions/atan2.texi
doc/posix-functions/cbrt.texi
doc/posix-functions/copysign.texi
doc/posix-functions/cos.texi
doc/posix-functions/cosh.texi
doc/posix-functions/erf.texi
doc/posix-functions/erfc.texi
doc/posix-functions/exp.texi
doc/posix-functions/fabs.texi
doc/posix-functions/fmod.texi
doc/posix-functions/hypot.texi
doc/posix-functions/j0.texi
doc/posix-functions/j1.texi
doc/posix-functions/jn.texi
doc/posix-functions/ldexp.texi
doc/posix-functions/lgamma.texi
doc/posix-functions/log.texi
doc/posix-functions/log10.texi
doc/posix-functions/log1p.texi
doc/posix-functions/logb.texi
doc/posix-functions/modf.texi
doc/posix-functions/nextafter.texi
doc/posix-functions/pow.texi
doc/posix-functions/remainder.texi
doc/posix-functions/rint.texi
doc/posix-functions/sin.texi
doc/posix-functions/sinh.texi
doc/posix-functions/sqrt.texi
doc/posix-functions/tan.texi
doc/posix-functions/tanh.texi
doc/posix-functions/y0.texi
doc/posix-functions/y1.texi
doc/posix-functions/yn.texi
m4/mathfunc.m4 [new file with mode: 0644]
modules/acos [new file with mode: 0644]
modules/asin [new file with mode: 0644]
modules/atan [new file with mode: 0644]
modules/atan2 [new file with mode: 0644]
modules/cbrt [new file with mode: 0644]
modules/copysign [new file with mode: 0644]
modules/cos [new file with mode: 0644]
modules/cosh [new file with mode: 0644]
modules/erf [new file with mode: 0644]
modules/erfc [new file with mode: 0644]
modules/exp [new file with mode: 0644]
modules/fabs [new file with mode: 0644]
modules/fmod [new file with mode: 0644]
modules/hypot [new file with mode: 0644]
modules/j0 [new file with mode: 0644]
modules/j1 [new file with mode: 0644]
modules/jn [new file with mode: 0644]
modules/ldexp [new file with mode: 0644]
modules/lgamma [new file with mode: 0644]
modules/log [new file with mode: 0644]
modules/log10 [new file with mode: 0644]
modules/log1p [new file with mode: 0644]
modules/logb [new file with mode: 0644]
modules/modf [new file with mode: 0644]
modules/nextafter [new file with mode: 0644]
modules/pow [new file with mode: 0644]
modules/remainder [new file with mode: 0644]
modules/rint [new file with mode: 0644]
modules/sin [new file with mode: 0644]
modules/sinh [new file with mode: 0644]
modules/sqrt [new file with mode: 0644]
modules/tan [new file with mode: 0644]
modules/tanh [new file with mode: 0644]
modules/y0 [new file with mode: 0644]
modules/y1 [new file with mode: 0644]
modules/yn [new file with mode: 0644]

index f51ebc892b19ac9766e854b1155ef31bf7d2501f..63a4a417190d13c9ab7121756cea5efe22fc1572 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,80 @@
+2010-01-18  Bruno Haible  <bruno@clisp.org>
+
+       New modules for common <math.h> functions.
+       * m4/mathfunc.m4: New file.
+       * modules/acos: New file.
+       * modules/asin: New file.
+       * modules/atan: New file.
+       * modules/atan2: New file.
+       * modules/cbrt: New file.
+       * modules/copysign: New file.
+       * modules/cos: New file.
+       * modules/cosh: New file.
+       * modules/erf: New file.
+       * modules/erfc: New file.
+       * modules/exp: New file.
+       * modules/fabs: New file.
+       * modules/fmod: New file.
+       * modules/hypot: New file.
+       * modules/j0: New file.
+       * modules/j1: New file.
+       * modules/jn: New file.
+       * modules/ldexp: New file.
+       * modules/lgamma: New file.
+       * modules/log: New file.
+       * modules/log10: New file.
+       * modules/log1p: New file.
+       * modules/logb: New file.
+       * modules/modf: New file.
+       * modules/nextafter: New file.
+       * modules/pow: New file.
+       * modules/remainder: New file.
+       * modules/rint: New file.
+       * modules/sin: New file.
+       * modules/sinh: New file.
+       * modules/sqrt: New file.
+       * modules/tan: New file.
+       * modules/tanh: New file.
+       * modules/y0: New file.
+       * modules/y1: New file.
+       * modules/yn: New file.
+       * doc/posix-functions/acos.texi: Mention the 'acos' module.
+       * doc/posix-functions/asin.texi: Mention the 'asin' module.
+       * doc/posix-functions/atan.texi: Mention the 'atan' module.
+       * doc/posix-functions/atan2.texi: Mention the 'atan2' module.
+       * doc/posix-functions/cbrt.texi: Mention the 'cbrt' module.
+       * doc/posix-functions/copysign.texi: Mention the 'copysign' module.
+       * doc/posix-functions/cos.texi: Mention the 'cos' module.
+       * doc/posix-functions/cosh.texi: Mention the 'cosh' module.
+       * doc/posix-functions/erf.texi: Mention the 'erf' module.
+       * doc/posix-functions/erfc.texi: Mention the 'erfc' module.
+       * doc/posix-functions/exp.texi: Mention the 'exp' module.
+       * doc/posix-functions/fabs.texi: Mention the 'fabs' module.
+       * doc/posix-functions/fmod.texi: Mention the 'fmod' module.
+       * doc/posix-functions/hypot.texi: Mention the 'hypot' module.
+       * doc/posix-functions/j0.texi: Mention the 'j0' module.
+       * doc/posix-functions/j1.texi: Mention the 'j1' module.
+       * doc/posix-functions/jn.texi: Mention the 'jn' module.
+       * doc/posix-functions/ldexp.texi: Mention the 'ldexp' module.
+       * doc/posix-functions/lgamma.texi: Mention the 'lgamma' module.
+       * doc/posix-functions/log.texi: Mention the 'log' module.
+       * doc/posix-functions/log10.texi: Mention the 'log10' module.
+       * doc/posix-functions/log1p.texi: Mention the 'log1p' module.
+       * doc/posix-functions/logb.texi: Mention the 'logb' module.
+       * doc/posix-functions/modf.texi: Mention the 'modf' module.
+       * doc/posix-functions/nextafter.texi: Mention the 'nextafter' module.
+       * doc/posix-functions/pow.texi: Mention the 'pow' module.
+       * doc/posix-functions/remainder.texi: Mention the 'remainder' module.
+       * doc/posix-functions/rint.texi: Mention the 'rint' module.
+       * doc/posix-functions/sin.texi: Mention the 'sin' module.
+       * doc/posix-functions/sinh.texi: Mention the 'sinh' module.
+       * doc/posix-functions/sqrt.texi: Mention the 'sqrt' module.
+       * doc/posix-functions/tan.texi: Mention the 'tan' module.
+       * doc/posix-functions/tanh.texi: Mention the 'tanh' module.
+       * doc/posix-functions/y0.texi: Mention the 'y0' module.
+       * doc/posix-functions/y1.texi: Mention the 'y1' module.
+       * doc/posix-functions/yn.texi: Mention the 'yn' module.
+
 2010-01-18  Jim Meyering  <meyering@redhat.com>
 
        ignore-value: relax license to LGPLv2+
index cf23e57d6dcc377df1ceafbe4bda8a6b91df5904..e4b9f9c7e1c1cb90ebe54f6ff62ddb5eaa512655 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/acos.html}
 
-Gnulib module: ---
+Gnulib module: acos
 
 Portability problems fixed by Gnulib:
 @itemize
index 99c43185c8c683f044da509a623a4e30cd928ea0..cca5091b86e351149c290d05233da468314f0d40 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/asin.html}
 
-Gnulib module: ---
+Gnulib module: asin
 
 Portability problems fixed by Gnulib:
 @itemize
index 44ebcf41f9ddc0d7fe05db8a7876b5f69928dd39..21cfd07b92486ff5323661e0375c1731939d0861 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/atan.html}
 
-Gnulib module: ---
+Gnulib module: atan
 
 Portability problems fixed by Gnulib:
 @itemize
index 430a4b4a28877e85bfb4867920b7725721ba76e4..d584801be34c7d807a6385a243c5929876aa3f87 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/atan2.html}
 
-Gnulib module: ---
+Gnulib module: atan2
 
 Portability problems fixed by Gnulib:
 @itemize
index 67077a84b85a5a96c47c84d63ec8bda7770dac58..2e3a6a1ac4a05b8f6e69b83664f97f81a990b94d 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/cbrt.html}
 
-Gnulib module: ---
+Gnulib module: cbrt
 
 Portability problems fixed by Gnulib:
 @itemize
index c6d6f78ca3f93edec38db2ee3c08bd05b9243865..dd8ebc21411418f800f13e32a5fb8c632838d16d 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/copysign.html}
 
-Gnulib module: ---
+Gnulib module: copysign
 
 Portability problems fixed by Gnulib:
 @itemize
index e71d8c7e9b301e1442355ccb4168b2b0d42d44a6..f161e18446c814c77527d59fdba24c476ab4fa36 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/cos.html}
 
-Gnulib module: ---
+Gnulib module: cos
 
 Portability problems fixed by Gnulib:
 @itemize
index ab43b142f80612116c15ed0cff33831c061f0b73..d4653a1279c806d040c292e4df6f06349403a2ef 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/cosh.html}
 
-Gnulib module: ---
+Gnulib module: cosh
 
 Portability problems fixed by Gnulib:
 @itemize
index 291f0a20cfa7a8156ffd8122b56fe739a0b817af..861ee64a143977afce3de35b0d12430f6d13370c 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/erf.html}
 
-Gnulib module: ---
+Gnulib module: erf
 
 Portability problems fixed by Gnulib:
 @itemize
index 3a9f42fb6218d0ddbeb0c45b5b17b6ec36e81748..7076cb872d7aff7c70b0cd22cb527327d7c39e91 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/erfc.html}
 
-Gnulib module: ---
+Gnulib module: erfc
 
 Portability problems fixed by Gnulib:
 @itemize
index bcbecf3510091f085ec2c2e93e00f87397a973ed..4eed5013ee30359e47ba16e521c48ed671f84df6 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/exp.html}
 
-Gnulib module: ---
+Gnulib module: exp
 
 Portability problems fixed by Gnulib:
 @itemize
index 0cf43e1d9dccbe3bdf0ecd4ec919f401ffeba621..77ea56179dfd73a282af87f9ce1a386245758938 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/fabs.html}
 
-Gnulib module: ---
+Gnulib module: fabs
 
 Portability problems fixed by Gnulib:
 @itemize
index d1330d980b709b32f700b6a40999c0c672b0b086..9cfa5629bd301aad0269bce62da2b5af820620fb 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/fmod.html}
 
-Gnulib module: ---
+Gnulib module: fmod
 
 Portability problems fixed by Gnulib:
 @itemize
index 7d7b7f9aa77f6da8077d70d2fe2405c5f3560ab0..bff9a6c25a5806b6f86416c828229b6a405555ea 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/hypot.html}
 
-Gnulib module: ---
+Gnulib module: hypot
 
 Portability problems fixed by Gnulib:
 @itemize
index 9b8e0a25d6b1e9ca8049c34e6d6be8e6e2ffe894..e0ed5bc10f00f8b7f1325cb0470756fc0526817d 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/j0.html}
 
-Gnulib module: ---
+Gnulib module: j0
 
 Portability problems fixed by Gnulib:
 @itemize
index 96ee617310136c14625c03f07762fc067ad861c4..b906998a5e7ae91654eaa1735129f51da9f21930 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/j1.html}
 
-Gnulib module: ---
+Gnulib module: j1
 
 Portability problems fixed by Gnulib:
 @itemize
index 8b875d6ba91fc2886a619a983a874a4624f6d291..58b26ae1a43c1b93a3cdfd554a13c5e926c0336f 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/jn.html}
 
-Gnulib module: ---
+Gnulib module: jn
 
 Portability problems fixed by Gnulib:
 @itemize
index 7d36efe45ae24865f6df164a710dc2019e8abeb3..ac1bffc4ff204c36de530f8ea69d402bf004d84c 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/ldexp.html}
 
-Gnulib module: ---
+Gnulib module: ldexp
 
 Portability problems fixed by Gnulib:
 @itemize
index c9960c0113c66390b56813420978858e5e548c98..3ac4fd241c805fadc4c951dba1d8f52aca94cc2e 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/lgamma.html}
 
-Gnulib module: ---
+Gnulib module: lgamma
 
 Portability problems fixed by Gnulib:
 @itemize
index 9cfd207786138eb0a657973d4fa26342c75673e2..001e3474048d046640fb552e8ec30d835b9838b0 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/log.html}
 
-Gnulib module: ---
+Gnulib module: log
 
 Portability problems fixed by Gnulib:
 @itemize
index 69c879c481e4390856fdda51b47abb5bd1ff7396..90e3e8debab2fba64ffdb18b42c4647781ddfcbd 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/log10.html}
 
-Gnulib module: ---
+Gnulib module: log10
 
 Portability problems fixed by Gnulib:
 @itemize
index 786b76a8f1b2a1f5cf592495b7697f64e13fe464..d195e855ab8d2e1863dbd23e5745dc7d7788b9bc 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/log1p.html}
 
-Gnulib module: ---
+Gnulib module: log1p
 
 Portability problems fixed by Gnulib:
 @itemize
index acbdcb6fddde0f2fb01e140b824d0bb6d2000a2c..7cbd9986020ecfd837d4614422bb34597fd381ce 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/logb.html}
 
-Gnulib module: ---
+Gnulib module: logb
 
 Portability problems fixed by Gnulib:
 @itemize
index f2525f4016cf73e835560b7cd593eca238e04bba..6524a60b12a046f617571f36dbababe4d8b099e7 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/modf.html}
 
-Gnulib module: ---
+Gnulib module: modf
 
 Portability problems fixed by Gnulib:
 @itemize
index d715a9275de3aae71c5662bce340b0adfab616d8..c7bed98ef948be8fe085f3d27654ef494d8960db 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/nextafter.html}
 
-Gnulib module: ---
+Gnulib module: nextafter
 
 Portability problems fixed by Gnulib:
 @itemize
index 30741552565a7f1930f861b75fabc24edb1ed1f7..1fd5184b3f37545831fab83774bc1039463ac28e 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/pow.html}
 
-Gnulib module: ---
+Gnulib module: pow
 
 Portability problems fixed by Gnulib:
 @itemize
index 8aeec9136e31f95569a5beb57d36e4fee6e818f6..1eab409b00ed2df3f64972a486ed07bce74d4081 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/remainder.html}
 
-Gnulib module: ---
+Gnulib module: remainder
 
 Portability problems fixed by Gnulib:
 @itemize
index 0310afb8de3fddfd1c20d88ba2aa157d4a64c675..12ab1d1504a31ed66f56aace77f028fd9823ad4d 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/rint.html}
 
-Gnulib module: ---
+Gnulib module: rint
 
 Portability problems fixed by Gnulib:
 @itemize
index 927e97ef4f3a7aa5f47011277e7d35a3b1569fbd..28071ccfb074bb702ada94ccff985a255c60c4c1 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/sin.html}
 
-Gnulib module: ---
+Gnulib module: sin
 
 Portability problems fixed by Gnulib:
 @itemize
index 4e97f3f61b83fd077fc195fe1534ebe1035ebc58..09fa8f9e96a2c9dba1dd26ac07aa118d6f92be6d 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/sinh.html}
 
-Gnulib module: ---
+Gnulib module: sinh
 
 Portability problems fixed by Gnulib:
 @itemize
index 7dc27637c2fe7924dbac8dbc14fbd0421d0857f2..70ac1c503dff92eb012a466600dc064d4dcec3a4 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/sqrt.html}
 
-Gnulib module: ---
+Gnulib module: sqrt
 
 Portability problems fixed by Gnulib:
 @itemize
index 0ad6e8ad40fbc4cb9fc1e4d0e40263a0945c9e7f..be55a25171746610fd1ce561265cbffc3adace37 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/tan.html}
 
-Gnulib module: ---
+Gnulib module: tan
 
 Portability problems fixed by Gnulib:
 @itemize
index 0bdae8cfb1930c736858feaed82009a10dc1be53..71c27f7ed8ff3c98bcc9b3ad4881aa8c1e700589 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/tanh.html}
 
-Gnulib module: ---
+Gnulib module: tanh
 
 Portability problems fixed by Gnulib:
 @itemize
index 0748dec4eb44e1ba8607627ece6b8416b5905772..1b215025da04bd7585aab767da4a7bfb2c39195b 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/y0.html}
 
-Gnulib module: ---
+Gnulib module: y0
 
 Portability problems fixed by Gnulib:
 @itemize
index 775015023062af2a3179da77a9f3e7491a97bf97..6e703a0588e25c8af71f23c7c260dca7ef6b51fc 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/y1.html}
 
-Gnulib module: ---
+Gnulib module: y1
 
 Portability problems fixed by Gnulib:
 @itemize
index bafed151a43e3d3c82678ef7847c77a04bdfb8bf..fef9d5de1172fc63b18f6d16e4076bafabb91679 100644 (file)
@@ -4,7 +4,7 @@
 
 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/yn.html}
 
-Gnulib module: ---
+Gnulib module: yn
 
 Portability problems fixed by Gnulib:
 @itemize
diff --git a/m4/mathfunc.m4 b/m4/mathfunc.m4
new file mode 100644 (file)
index 0000000..8d9d826
--- /dev/null
@@ -0,0 +1,53 @@
+# mathfunc.m4 serial 1
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# gl_MATHFUNC([sqrt])
+# tests whether the sqrt function is available in libc or libm. It sets
+# SQRT_LIBM to empty or "-lm" accordingly.
+
+AC_DEFUN([gl_MATHFUNC],
+[
+  m4_pushdef([func], [$1])
+  m4_pushdef([FUNC], [translit([$1],[abcdefghijklmnopqrstuvwxyz],
+                                    [ABCDEFGHIJKLMNOPQRSTUVWXYZ])])
+  FUNC[]_LIBM=
+  AC_CACHE_CHECK([whether func() can be used without linking with libm],
+    [gl_cv_func_]func[_no_libm],
+    [
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM([[#ifndef __NO_MATH_INLINES
+                           # define __NO_MATH_INLINES 1 /* for glibc */
+                           #endif
+                           #include <math.h>
+                           double x;]],
+                         [[return ]func[ (x) > 2 || ]func[ (x) < 0.4;]])],
+        [gl_cv_func_]func[_no_libm=yes],
+        [gl_cv_func_]func[_no_libm=no])
+    ])
+  if test $gl_cv_func_[]func[]_no_libm = no; then
+    AC_CACHE_CHECK([whether func() can be used with libm],
+      [gl_cv_func_]func[_in_libm],
+      [
+        save_LIBS="$LIBS"
+        LIBS="$LIBS -lm"
+        AC_LINK_IFELSE(
+          [AC_LANG_PROGRAM([[#ifndef __NO_MATH_INLINES
+                             # define __NO_MATH_INLINES 1 /* for glibc */
+                             #endif
+                             #include <math.h>
+                             double x;]],
+                           [[return ]func[ (x) > 2 || ]func[ (x) < 0.4;]])],
+          [gl_cv_func_]func[_in_libm=yes],
+          [gl_cv_func_]func[_in_libm=no])
+        LIBS="$save_LIBS"
+      ])
+    if test $gl_cv_func_[]func[]_in_libm = yes; then
+      FUNC[]_LIBM=-lm
+    fi
+  fi
+  m4_popdef([FUNC])
+  m4_popdef([func])
+])
diff --git a/modules/acos b/modules/acos
new file mode 100644 (file)
index 0000000..472fd7b
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+acos() function: inverse cosine function.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([acos])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(ACOS_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/asin b/modules/asin
new file mode 100644 (file)
index 0000000..1e42c07
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+asin() function: inverse sine function.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([asin])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(ASIN_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/atan b/modules/atan
new file mode 100644 (file)
index 0000000..811d70e
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+atan() function: inverse tangent function.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([atan])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(ATAN_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/atan2 b/modules/atan2
new file mode 100644 (file)
index 0000000..fc31267
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+atan2() function: angle of a point in the plane.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([atan2])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(ATAN2_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/cbrt b/modules/cbrt
new file mode 100644 (file)
index 0000000..c88da57
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+cbrt() function: cube root.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([cbrt])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(CBRT_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/copysign b/modules/copysign
new file mode 100644 (file)
index 0000000..6c919ae
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+copysign() function: copy sign.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([copysign])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(COPYSIGN_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/cos b/modules/cos
new file mode 100644 (file)
index 0000000..77a4aca
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+cos() function: cosine function.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([cos])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(COS_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/cosh b/modules/cosh
new file mode 100644 (file)
index 0000000..4a9d71e
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+cosh() function: hyperbolic cosine function.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([cosh])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(COSH_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/erf b/modules/erf
new file mode 100644 (file)
index 0000000..8315997
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+erf() function: error function.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([erf])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(ERF_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/erfc b/modules/erfc
new file mode 100644 (file)
index 0000000..d2b8aed
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+erfc() function: complementary error function.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([erfc])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(ERFC_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/exp b/modules/exp
new file mode 100644 (file)
index 0000000..51bbce3
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+exp() function: exponential function.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([exp])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(EXP_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/fabs b/modules/fabs
new file mode 100644 (file)
index 0000000..b621c3f
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+fabs() function: absolute value.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([fabs])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(FABS_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/fmod b/modules/fmod
new file mode 100644 (file)
index 0000000..0862fe9
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+fmod() function: floating-point remainder function.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([fmod])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(FMOD_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/hypot b/modules/hypot
new file mode 100644 (file)
index 0000000..3a58d28
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+hypot() function: length of a vector in the plane.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([hypot])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(HYPOT_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/j0 b/modules/j0
new file mode 100644 (file)
index 0000000..215180c
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+j0() function: Bessel function of the first kind of order 0.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([j0])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(J0_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/j1 b/modules/j1
new file mode 100644 (file)
index 0000000..b2480c5
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+j1() function: Bessel function of the first kind of order 1.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([j1])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(J1_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/jn b/modules/jn
new file mode 100644 (file)
index 0000000..6eff0e3
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+jn() function: Bessel function of the first kind of order n.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([jn])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(JN_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/ldexp b/modules/ldexp
new file mode 100644 (file)
index 0000000..eaa4a13
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+ldexp() function: multiply a 'double' by a power of 2.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([ldexp])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(LDEXP_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/lgamma b/modules/lgamma
new file mode 100644 (file)
index 0000000..5a2d537
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+lgamma() function: log of gamma function.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([lgamma])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(LGAMMA_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/log b/modules/log
new file mode 100644 (file)
index 0000000..5e7d833
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+log() function: natural logarithmic function.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([log])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(LOG_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/log10 b/modules/log10
new file mode 100644 (file)
index 0000000..d3d8bbf
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+log10() function: base 10 logarithmic function.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([log10])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(LOG10_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/log1p b/modules/log1p
new file mode 100644 (file)
index 0000000..7c00614
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+log1p() function: natural logarithm of 1 plus argument.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([log1p])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(LOG1P_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/logb b/modules/logb
new file mode 100644 (file)
index 0000000..0388803
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+logb() function: get exponent.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([logb])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(LOGB_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/modf b/modules/modf
new file mode 100644 (file)
index 0000000..a075374
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+modf() function: get signed integer and fractional parts.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([modf])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(MODF_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/nextafter b/modules/nextafter
new file mode 100644 (file)
index 0000000..8b6d4a7
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+nextafter() function: next representable 'double' number.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([nextafter])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(NEXTAFTER_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/pow b/modules/pow
new file mode 100644 (file)
index 0000000..8eead48
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+pow() function: power function.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([pow])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(POW_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/remainder b/modules/remainder
new file mode 100644 (file)
index 0000000..2d35318
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+remainder() function: floating-point remainder function.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([remainder])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(REMAINDER_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/rint b/modules/rint
new file mode 100644 (file)
index 0000000..304bcf5
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+rint() function: round to nearest integer.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([rint])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(RINT_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/sin b/modules/sin
new file mode 100644 (file)
index 0000000..0d8dc60
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+sin() function: sine function.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([sin])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(SIN_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/sinh b/modules/sinh
new file mode 100644 (file)
index 0000000..d1c5c1f
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+sinh() function: hyperbolic sine function.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([sinh])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(SINH_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/sqrt b/modules/sqrt
new file mode 100644 (file)
index 0000000..b425ca4
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+sqrt() function: square root.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([sqrt])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(SQRT_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/tan b/modules/tan
new file mode 100644 (file)
index 0000000..2b2ecee
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+tan() function: tangent function.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([tan])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(TAN_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/tanh b/modules/tanh
new file mode 100644 (file)
index 0000000..3e5e309
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+tanh() function: hyperbolic tangent function.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([tanh])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(TANH_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/y0 b/modules/y0
new file mode 100644 (file)
index 0000000..bb1cfb6
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+y0() function: Bessel function of the second kind of order 0.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([y0])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(Y0_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/y1 b/modules/y1
new file mode 100644 (file)
index 0000000..27dcdaa
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+y1() function: Bessel function of the second kind of order 1.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([y1])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(Y1_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
diff --git a/modules/yn b/modules/yn
new file mode 100644 (file)
index 0000000..eab9f58
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+yn() function: Bessel function of the second kind of order n.
+
+Files:
+m4/mathfunc.m4
+
+Depends-on:
+
+configure.ac:
+gl_MATHFUNC([yn])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(YN_LIBM)
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible