-#include "libm.h"
+#include <math.h>
double fdim(double x, double y)
{
-#include "libm.h"
+#include <math.h>
float fdimf(float x, float y)
{
-#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)
-#include "libm.h"
+#include <math.h>
double fmax(double x, double y)
{
-#include "libm.h"
+#include <math.h>
float fmaxf(float x, float y)
{
-#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)
-#include "libm.h"
+#include <math.h>
double fmin(double x, double y)
{
-#include "libm.h"
+#include <math.h>
float fminf(float x, float y)
{
-#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 (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;
}
-#include "libm.h"
+#include <math.h>
double ldexp(double x, int n)
{
-#include "libm.h"
+#include <math.h>
float ldexpf(float x, int n)
{
-#include "libm.h"
+#include <math.h>
long double ldexpl(long double x, int n)
{
-#include "libm.h"
+#include <math.h>
+#include <float.h>
+
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long long llrintl(long double x)
{
-#include "libm.h"
+#include <math.h>
+#include <float.h>
+
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long long llroundl(long double x)
{
-#include "libm.h"
+#include <math.h>
+#include <float.h>
+
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long lrintl(long double x)
{
-#include "libm.h"
+#include <math.h>
+#include <float.h>
+
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long lroundl(long double x)
{
#include <fenv.h>
-#include "libm.h"
+#include <math.h>
/*
rint may raise inexact (and it should not alter the fenv otherwise)
#include <fenv.h>
-#include "libm.h"
+#include <math.h>
float nearbyintf(float x) {
fenv_t e;
-#include "libm.h"
+#include <math.h>
+#include <float.h>
+
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long double nearbyintl(long double x)
{
*/
#include "libm.h"
+
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
double nexttoward(double x, long double y)
{
-#include "libm.h"
+#include <math.h>
long double nexttowardl(long double x, long double y)
{
-#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)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "libm.h"
+#include <math.h>
double round(double x)
{
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "libm.h"
+#include <math.h>
float roundf(float x)
{
* 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)
{
* should use scalbn() instead.
*/
-#include "libm.h"
+#include <math.h>
double scalb(double x, double fn)
{
* ====================================================
*/
-#include "libm.h"
+#include <math.h>
float scalbf(float x, float fn)
{
#include <limits.h>
-#include "libm.h"
+#include <math.h>
double scalbln(double x, long n)
{
#include <limits.h>
-#include "libm.h"
+#include <math.h>
float scalblnf(float x, long n)
{
#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)