Get more Python tests passing (#141)

This commit is contained in:
Justine Tunney 2021-08-16 15:26:31 -07:00
parent 916f19eea1
commit 59e1c245d1
141 changed files with 3536 additions and 1203 deletions

View file

@ -1,5 +1,5 @@
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│
vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi
Musl Libc
@ -26,28 +26,15 @@
*/
#include "libc/math.h"
#include "libc/tinymath/feval.internal.h"
#include "libc/tinymath/ldshape.internal.h"
asm(".ident\t\"\\n\\n\
Musl libc (MIT License)\\n\
Copyright 2005-2014 Rich Felker, et. al.\"");
asm(".include \"libc/disclaimer.inc\"");
/* clang-format off */
union ldshape {
long double f;
struct {
uint64_t m;
uint16_t se;
} i;
};
static inline void force_eval(long double x)
{
volatile long double y;
y = x;
}
long double nextafterl(long double x, long double y)
{
union ldshape ux, uy;
@ -80,6 +67,6 @@ long double nextafterl(long double x, long double y)
return x + x;
/* raise underflow if ux is subnormal or zero */
if ((ux.i.se & 0x7fff) == 0)
force_eval(x*x + ux.f*ux.f);
fevall(x*x + ux.f*ux.f);
return ux.f;
}