New module 'float'.
authorBruno Haible <bruno@clisp.org>
Sat, 19 May 2007 20:21:41 +0000 (20:21 +0000)
committerBruno Haible <bruno@clisp.org>
Sat, 19 May 2007 20:21:41 +0000 (20:21 +0000)
ChangeLog
doc/headers/float.texi
lib/float_.h [new file with mode: 0644]
m4/float_h.m4 [new file with mode: 0644]
modules/float [new file with mode: 0644]
modules/isnanl
modules/isnanl-nolibm
modules/mathl
modules/printf-frexpl
modules/signbit
modules/vasnprintf

index b36cd2ba696c98f463051e8d8475af907d4a2d78..167b468126faab3e400e4d36a862182a3bff2104 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2007-05-19  Bruno Haible  <bruno@clisp.org>
+
+       * lib/float_.h: New file.
+       * m4/float_h.m4: New file.
+       * modules/float: New file.
+       * modules/isnanl (Dependencies): Add float.
+       * modules/isnanl-nolibm (Dependencies): Likewise.
+       * modules/mathl (Dependencies): Likewise.
+       * modules/printf-frexpl (Dependencies): Likewise.
+       * modules/signbit (Dependencies): Likewise.
+       * modules/vasnprintf (Dependencies): Likewise.
+       * doc/headers/float.texi: Update.
+
 2007-05-19  Jim Meyering  <jim@meyering.net>
 
        * lib/utimens.c (gl_futimens): Rename from futimens,
index 4b26dc3081dba94852674bb453626dc5a3c7b496..72a2afc81e1f355167d5a7fb6351f074b31d664e 100644 (file)
@@ -3,10 +3,14 @@
 
 POSIX specification: @url{http://www.opengroup.org/susv3xbd/float.h.html}
 
-Gnulib module: ---
+Gnulib module: float
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+The values of @code{LDBL_*} macros are incorrect on some platforms:
+On BeOS, they are the same as the values of the @code{DBL_*} macros, although
+@samp{long double} is a larger type than @samp{double}.
 @end itemize
 
 Portability problems not fixed by Gnulib:
diff --git a/lib/float_.h b/lib/float_.h
new file mode 100644 (file)
index 0000000..78abba7
--- /dev/null
@@ -0,0 +1,59 @@
+/* A correct <float.h>.
+
+   Copyright (C) 2007 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _GL_FLOAT_H
+#define _GL_FLOAT_H
+
+#if @HAVE_INCLUDE_NEXT@
+# include_next <float.h>
+#else
+# include @ABSOLUTE_FLOAT_H@
+#endif
+
+/* 'long double' properties.  */
+#if defined __i386__ && defined __BEOS__
+/* Number of mantissa units, in base FLT_RADIX.  */
+# undef LDBL_MANT_DIG
+# define LDBL_MANT_DIG   64
+/* Number of decimal digits that sufficient for representing a number.  */
+# undef LDBL_DIG
+# define LDBL_DIG        18
+/* x-1 where x is the smallest representable number > 1.  */
+# undef LDBL_EPSILON
+# define LDBL_EPSILON    1.0842021724855044340E-19L
+/* Minimum e such that FLT_RADIX^(e-1) is a normalized number.  */
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP    (-16381)
+/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number.  */
+# undef LDBL_MAX_EXP
+# define LDBL_MAX_EXP    16384
+/* Minimum positive normalized number.  */
+# undef LDBL_MIN
+# define LDBL_MIN        3.3621031431120935063E-4932L
+/* Maximum representable finite number.  */
+# undef LDBL_MAX
+# define LDBL_MAX        1.1897314953572317650E+4932L
+/* Minimum e such that 10^e is in the range of normalized numbers.  */
+# undef LDBL_MIN_10_EXP
+# define LDBL_MIN_10_EXP (-4931)
+/* Maximum e such that 10^e is in the range of representable finite numbers.  */
+# undef LDBL_MAX_10_EXP
+# define LDBL_MAX_10_EXP 4932
+#endif
+
+#endif /* _GL_FLOAT_H */
diff --git a/m4/float_h.m4 b/m4/float_h.m4
new file mode 100644 (file)
index 0000000..36a07dc
--- /dev/null
@@ -0,0 +1,21 @@
+# float_h.m4 serial 1
+dnl Copyright (C) 2007 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.
+
+AC_DEFUN([gl_FLOAT_H],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  FLOAT_H=
+  case "$host_os" in
+    beos*)
+      FLOAT_H=float.h
+      gl_ABSOLUTE_HEADER([float.h])
+      ABSOLUTE_FLOAT_H=\"$gl_cv_absolute_float_h\"
+      AC_SUBST([ABSOLUTE_FLOAT_H])
+      ;;
+  esac
+  AC_SUBST([FLOAT_H])
+])
diff --git a/modules/float b/modules/float
new file mode 100644 (file)
index 0000000..9dce2b4
--- /dev/null
@@ -0,0 +1,36 @@
+Description:
+A correct <float.h>.
+
+Files:
+lib/float_.h
+m4/float_h.m4
+
+Depends-on:
+absolute-header
+
+configure.ac:
+gl_FLOAT_H
+
+Makefile.am:
+BUILT_SOURCES += $(FLOAT_H)
+
+# We need the following in order to create <float.h> when the system
+# doesn't have one that works with the given compiler.
+float.h: float_.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's|@''ABSOLUTE_FLOAT_H''@|$(ABSOLUTE_FLOAT_H)|g' \
+             -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \
+             < $(srcdir)/float_.h; \
+       } > $@-t
+       mv $@-t $@
+MOSTLYCLEANFILES += float.h float.h-t
+
+Include:
+<float.h>
+
+License:
+LGPL
+
+Maintainer:
+all
index 86907afd83e14f2c92e40936b8812c5a5d208cc1..026981f2740fe4c5258dd53b6e88d97f3c820159 100644 (file)
@@ -9,6 +9,7 @@ lib/float+.h
 m4/isnanl.m4
 
 Depends-on:
+float
 fpieee
 
 configure.ac:
index 1b753a567d72f3cacaed65d2ac9767a0b8fde7d6..9250fef0ea4bfb2d18fa5bd4aba5f0992ced3305 100644 (file)
@@ -9,6 +9,7 @@ lib/float+.h
 m4/isnanl.m4
 
 Depends-on:
+float
 fpieee
 
 configure.ac:
index d9c1b13b3ba23fda025d55cb0ef5a193f2f11558..892eea44172c7b4c11fad4e0713272825af0feab 100644 (file)
@@ -19,6 +19,7 @@ lib/trigl.h
 m4/mathl.m4
 
 Depends-on:
+float
 math
 frexpl
 isnanl
index c50c4c7578835f11ac02f03107d7b53c5aa428f1..c23550e1b69e7c2e5374a73d6424605880502544 100644 (file)
@@ -11,6 +11,7 @@ m4/frexpl.m4
 m4/ldexpl.m4
 
 Depends-on:
+float
 math
 fpucw
 
index 10c1840b0a93b770a74bf7f00510f912f381fa29..57ba154563a86eea6e3320b9b6a0d429c6c68d67 100644 (file)
@@ -9,6 +9,7 @@ lib/float+.h
 m4/signbit.m4
 
 Depends-on:
+float
 math
 isnanf-nolibm
 isnan-nolibm
index ce40449a84f709fa0c70802bc7a74e0f14de5be7..0a5aabc3af74d17dedaaec52ea0bab7c036182d4 100644 (file)
@@ -21,6 +21,7 @@ m4/vasnprintf.m4
 
 Depends-on:
 alloca-opt
+float
 stdint
 xsize