mirror of
https://github.com/fluencelabs/musl
synced 2025-06-30 23:21:56 +00:00
remove libm.h includes when math.h and float.h are enough
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
|
||||||
double fdim(double x, double y)
|
double fdim(double x, double y)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
|
||||||
float fdimf(float x, float y)
|
float fdimf(float x, float y)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
||||||
long double fdiml(long double x, long double y)
|
long double fdiml(long double x, long double y)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
|
||||||
double fmax(double x, double y)
|
double fmax(double x, double y)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
|
||||||
float fmaxf(float x, float y)
|
float fmaxf(float x, float y)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
||||||
long double fmaxl(long double x, long double y)
|
long double fmaxl(long double x, long double y)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
|
||||||
double fmin(double x, double y)
|
double fmin(double x, double y)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
|
||||||
float fminf(float x, float y)
|
float fminf(float x, float y)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
||||||
long double fminl(long double x, long double y)
|
long double fminl(long double x, long double y)
|
||||||
|
@ -11,7 +11,6 @@ int ilogb(double x)
|
|||||||
if (u.bits == 0)
|
if (u.bits == 0)
|
||||||
return FP_ILOGB0;
|
return FP_ILOGB0;
|
||||||
/* subnormal x */
|
/* 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);
|
for (e = -0x3ff; u.bits < (uint64_t)1<<63; e--, u.bits<<=1);
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
|
||||||
double ldexp(double x, int n)
|
double ldexp(double x, int n)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
|
||||||
float ldexpf(float x, int n)
|
float ldexpf(float x, int n)
|
||||||
{
|
{
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
||||||
long long llrintl(long double x)
|
long long llrintl(long double x)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
||||||
long long llroundl(long double x)
|
long long llroundl(long double x)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
||||||
long lrintl(long double x)
|
long lrintl(long double x)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
||||||
long lroundl(long double x)
|
long lroundl(long double x)
|
||||||
{
|
{
|
||||||
|
@ -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)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <fenv.h>
|
#include <fenv.h>
|
||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
|
||||||
float nearbyintf(float x) {
|
float nearbyintf(float x) {
|
||||||
fenv_t e;
|
fenv_t e;
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
||||||
long double nearbyintl(long double x)
|
long double nearbyintl(long double x)
|
||||||
{
|
{
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "libm.h"
|
#include "libm.h"
|
||||||
|
|
||||||
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
||||||
double nexttoward(double x, long double y)
|
double nexttoward(double x, long double y)
|
||||||
{
|
{
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
||||||
long double remainderl(long double x, long double y)
|
long double remainderl(long double x, long double y)
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -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
|
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
||||||
long double roundl(long double x)
|
long double roundl(long double x)
|
||||||
{
|
{
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
* ====================================================
|
* ====================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "libm.h"
|
#include <math.h>
|
||||||
|
|
||||||
float scalbf(float x, float fn)
|
float scalbf(float x, float fn)
|
||||||
{
|
{
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -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
|
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
||||||
long double scalblnl(long double x, long n)
|
long double scalblnl(long double x, long n)
|
||||||
|
Reference in New Issue
Block a user