remove libm.h includes when math.h and float.h are enough
authornsz <nsz@port70.net>
Tue, 13 Mar 2012 18:51:14 +0000 (19:51 +0100)
committernsz <nsz@port70.net>
Tue, 13 Mar 2012 18:51:14 +0000 (19:51 +0100)
31 files changed:
src/math/fdim.c
src/math/fdimf.c
src/math/fdiml.c
src/math/fmax.c
src/math/fmaxf.c
src/math/fmaxl.c
src/math/fmin.c
src/math/fminf.c
src/math/fminl.c
src/math/ilogb.c
src/math/ldexp.c
src/math/ldexpf.c
src/math/ldexpl.c
src/math/llrintl.c
src/math/llroundl.c
src/math/lrintl.c
src/math/lroundl.c
src/math/nearbyint.c
src/math/nearbyintf.c
src/math/nearbyintl.c
src/math/nexttoward.c
src/math/nexttowardl.c
src/math/remainderl.c
src/math/round.c
src/math/roundf.c
src/math/roundl.c
src/math/scalb.c
src/math/scalbf.c
src/math/scalbln.c
src/math/scalblnf.c
src/math/scalblnl.c

index fb25521..9585460 100644 (file)
@@ -1,4 +1,4 @@
-#include "libm.h"
+#include <math.h>
 
 double fdim(double x, double y)
 {
 
 double fdim(double x, double y)
 {
index 5cfeac6..543c364 100644 (file)
@@ -1,4 +1,4 @@
-#include "libm.h"
+#include <math.h>
 
 float fdimf(float x, float y)
 {
 
 float fdimf(float x, float y)
 {
index cda3022..62e29b7 100644 (file)
@@ -1,4 +1,5 @@
-#include "libm.h"
+#include <math.h>
+#include <float.h>
 
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long double fdiml(long double x, long double y)
 
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long double fdiml(long double x, long double y)
index 0b6bf6f..94f0caa 100644 (file)
@@ -1,4 +1,4 @@
-#include "libm.h"
+#include <math.h>
 
 double fmax(double x, double y)
 {
 
 double fmax(double x, double y)
 {
index 7767c30..695d817 100644 (file)
@@ -1,4 +1,4 @@
-#include "libm.h"
+#include <math.h>
 
 float fmaxf(float x, float y)
 {
 
 float fmaxf(float x, float y)
 {
index 8a1e365..4b03158 100644 (file)
@@ -1,4 +1,5 @@
-#include "libm.h"
+#include <math.h>
+#include <float.h>
 
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long double fmaxl(long double x, long double y)
 
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long double fmaxl(long double x, long double y)
index d1f1645..08a8fd1 100644 (file)
@@ -1,4 +1,4 @@
-#include "libm.h"
+#include <math.h>
 
 double fmin(double x, double y)
 {
 
 double fmin(double x, double y)
 {
index 0964cdb..3573c7d 100644 (file)
@@ -1,4 +1,4 @@
-#include "libm.h"
+#include <math.h>
 
 float fminf(float x, float y)
 {
 
 float fminf(float x, float y)
 {
index ae7159a..69bc24a 100644 (file)
@@ -1,4 +1,5 @@
-#include "libm.h"
+#include <math.h>
+#include <float.h>
 
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long double fminl(long double x, long double y)
 
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long double fminl(long double x, long double y)
index c5915a0..0a3a6a4 100644 (file)
@@ -11,7 +11,6 @@ int ilogb(double x)
                if (u.bits == 0)
                        return FP_ILOGB0;
                /* subnormal x */
                if (u.bits == 0)
                        return FP_ILOGB0;
                /* subnormal x */
-               // FIXME: scale up subnormals with a *0x1p53 or find top set bit with a better method
                for (e = -0x3ff; u.bits < (uint64_t)1<<63; e--, u.bits<<=1);
                return e;
        }
                for (e = -0x3ff; u.bits < (uint64_t)1<<63; e--, u.bits<<=1);
                return e;
        }
index 36835db..f4d1cd6 100644 (file)
@@ -1,4 +1,4 @@
-#include "libm.h"
+#include <math.h>
 
 double ldexp(double x, int n)
 {
 
 double ldexp(double x, int n)
 {
index f0981ae..3bad5f3 100644 (file)
@@ -1,4 +1,4 @@
-#include "libm.h"
+#include <math.h>
 
 float ldexpf(float x, int n)
 {
 
 float ldexpf(float x, int n)
 {
index 885ff6e..fd145cc 100644 (file)
@@ -1,4 +1,4 @@
-#include "libm.h"
+#include <math.h>
 
 long double ldexpl(long double x, int n)
 {
 
 long double ldexpl(long double x, int n)
 {
index 6b0838d..ec2cf86 100644 (file)
@@ -1,4 +1,6 @@
-#include "libm.h"
+#include <math.h>
+#include <float.h>
+
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long long llrintl(long double x)
 {
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long long llrintl(long double x)
 {
index 9e2cfdc..107744a 100644 (file)
@@ -1,4 +1,6 @@
-#include "libm.h"
+#include <math.h>
+#include <float.h>
+
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long long llroundl(long double x)
 {
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long long llroundl(long double x)
 {
index 7c09653..c076326 100644 (file)
@@ -1,4 +1,6 @@
-#include "libm.h"
+#include <math.h>
+#include <float.h>
+
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long lrintl(long double x)
 {
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long lrintl(long double x)
 {
index 1469127..7b593f7 100644 (file)
@@ -1,4 +1,6 @@
-#include "libm.h"
+#include <math.h>
+#include <float.h>
+
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long lroundl(long double x)
 {
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long lroundl(long double x)
 {
index 781769f..714c55c 100644 (file)
@@ -1,5 +1,5 @@
 #include <fenv.h>
 #include <fenv.h>
-#include "libm.h"
+#include <math.h>
 
 /*
 rint may raise inexact (and it should not alter the fenv otherwise)
 
 /*
 rint may raise inexact (and it should not alter the fenv otherwise)
index e4bdb26..07df8f5 100644 (file)
@@ -1,5 +1,5 @@
 #include <fenv.h>
 #include <fenv.h>
-#include "libm.h"
+#include <math.h>
 
 float nearbyintf(float x) {
        fenv_t e;
 
 float nearbyintf(float x) {
        fenv_t e;
index b58527c..2906f38 100644 (file)
@@ -1,4 +1,6 @@
-#include "libm.h"
+#include <math.h>
+#include <float.h>
+
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long double nearbyintl(long double x)
 {
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long double nearbyintl(long double x)
 {
index 5e12c48..e150eaa 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include "libm.h"
  */
 
 #include "libm.h"
+
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 double nexttoward(double x, long double y)
 {
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 double nexttoward(double x, long double y)
 {
index c393ce9..67a6340 100644 (file)
@@ -1,4 +1,4 @@
-#include "libm.h"
+#include <math.h>
 
 long double nexttowardl(long double x, long double y)
 {
 
 long double nexttowardl(long double x, long double y)
 {
index b99f938..2a13c1d 100644 (file)
@@ -1,4 +1,5 @@
-#include "libm.h"
+#include <math.h>
+#include <float.h>
 
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long double remainderl(long double x, long double y)
 
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long double remainderl(long double x, long double y)
index 2137384..bf0b453 100644 (file)
@@ -25,7 +25,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "libm.h"
+#include <math.h>
 
 double round(double x)
 {
 
 double round(double x)
 {
index 3cfd8ae..662a454 100644 (file)
@@ -25,7 +25,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "libm.h"
+#include <math.h>
 
 float roundf(float x)
 {
 
 float roundf(float x)
 {
index ce56e8a..99146f0 100644 (file)
@@ -25,7 +25,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "libm.h"
+#include <math.h>
+#include <float.h>
+
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long double roundl(long double x)
 {
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long double roundl(long double x)
 {
index 7706e9c..a54bdf2 100644 (file)
@@ -15,7 +15,7 @@
  * should use scalbn() instead.
  */
 
  * should use scalbn() instead.
  */
 
-#include "libm.h"
+#include <math.h>
 
 double scalb(double x, double fn)
 {
 
 double scalb(double x, double fn)
 {
index 0cc091f..d08f2a1 100644 (file)
@@ -13,7 +13,7 @@
  * ====================================================
  */
 
  * ====================================================
  */
 
-#include "libm.h"
+#include <math.h>
 
 float scalbf(float x, float fn)
 {
 
 float scalbf(float x, float fn)
 {
index 53854fd..e6f3f19 100644 (file)
@@ -1,5 +1,5 @@
 #include <limits.h>
 #include <limits.h>
-#include "libm.h"
+#include <math.h>
 
 double scalbln(double x, long n)
 {
 
 double scalbln(double x, long n)
 {
index 61600f1..d8e8166 100644 (file)
@@ -1,5 +1,5 @@
 #include <limits.h>
 #include <limits.h>
-#include "libm.h"
+#include <math.h>
 
 float scalblnf(float x, long n)
 {
 
 float scalblnf(float x, long n)
 {
index 82ebbed..854c51c 100644 (file)
@@ -1,5 +1,6 @@
 #include <limits.h>
 #include <limits.h>
-#include "libm.h"
+#include <math.h>
+#include <float.h>
 
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long double scalblnl(long double x, long n)
 
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long double scalblnl(long double x, long n)