Improve documentation

The Cosmo API documentation page is pretty good now
https://justine.lol/cosmopolitan/documentation.html
This commit is contained in:
Justine Tunney 2020-12-27 07:02:35 -08:00
parent 13437dd19b
commit 1bc3a25505
367 changed files with 2542 additions and 26178 deletions

View file

@ -1,3 +1,4 @@
#include "libc/math.h"
#include "third_party/chibicc/test/test.h"
#define FPNAN 0
@ -115,6 +116,31 @@ void test_fpclassify(void) {
ASSERT(FPNAN, FPCLASSIFY(__builtin_nanl("")));
}
void test_logb(void) {
ASSERT(6, __builtin_logbl(123.456));
ASSERT(logbl(123.456L), __builtin_logbl(123.456L));
ASSERT(logbl(__LDBL_MIN__), __builtin_logbl(__LDBL_MIN__));
ASSERT(logbl(__LDBL_MAX__), __builtin_logbl(__LDBL_MAX__));
}
void test_fmax(void) {
ASSERT(fmaxl(1, 2), __builtin_fmaxl(1, 2));
ASSERT(2, __builtin_fmaxl(__builtin_nanl(""), 2));
ASSERT(1, __builtin_fmaxl(1, __builtin_nanl("")));
ASSERT(2, fmaxl(nanl(""), 2));
ASSERT(1, fmaxl(1, nanl("")));
ASSERT(fmaxf(1, 2), __builtin_fmaxf(1, 2));
ASSERT(2, __builtin_fmaxf(__builtin_nanl(""), 2));
ASSERT(1, __builtin_fmaxf(1, __builtin_nanl("")));
ASSERT(2, fmaxf(nanl(""), 2));
ASSERT(1, fmaxf(1, nanl("")));
ASSERT(fmax(1, 2), __builtin_fmax(1, 2));
ASSERT(2, __builtin_fmax(__builtin_nanl(""), 2));
ASSERT(1, __builtin_fmax(1, __builtin_nanl("")));
ASSERT(2, fmax(nanl(""), 2));
ASSERT(1, fmax(1, nanl("")));
}
void test_strlen(void) {
ASSERT(5, strlen("hello"));
ASSERT(5, __builtin_strlen("hello"));
@ -414,5 +440,7 @@ int main() {
test_strchr();
test_strpbrk();
test_strstr();
test_logb();
test_fmax();
return 0;
}