Perform some code cleanup

This commit is contained in:
Justine Tunney 2023-05-15 16:32:10 -07:00
parent cc1732bc42
commit 210187cf77
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
205 changed files with 1748 additions and 2595 deletions

View file

@ -27,6 +27,7 @@
*/
#include "libc/math.h"
#include "libc/tinymath/ldshape.internal.h"
#if !(LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024)
asm(".ident\t\"\\n\\n\
Musl libc (MIT License)\\n\
@ -34,10 +35,11 @@ Copyright 2005-2014 Rich Felker, et. al.\"");
asm(".include \"libc/disclaimer.inc\"");
// clang-format off
long double exp10l(long double x) {
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
return exp10(x);
#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
/**
* Returns 10ˣ.
*/
long double exp10l(long double x)
{
static const long double p10[] = {
1e-15L, 1e-14L, 1e-13L, 1e-12L, 1e-11L, 1e-10L,
1e-9L, 1e-8L, 1e-7L, 1e-6L, 1e-5L, 1e-4L, 1e-3L, 1e-2L, 1e-1L,
@ -53,7 +55,8 @@ long double exp10l(long double x) {
return y * p10[(int)n+15];
}
return powl(10.0, x);
#else
#error "architecture unsupported"
#endif
}
__strong_reference(exp10l, pow10l);
#endif /* long double is long */