mirror of
https://github.com/TinyCC/tinycc.git
synced 2025-11-16 12:34:45 +00:00
WIN32/64 only: Added C99 math functions: tgamma(), tgammaf(), lgamma(), lgammaf(), cbrt(), cbrtf(), log2(), log2f(), exp2(), exp2f().
The gamma() functions are accurate to 13 digits over the full range. Returns INFINITY / NAN identical to other compiler's math libs.
#include <stdio.h>
#include <math.h>
int main() {
double x;
for (x = -7.0; x <= 520.0; x += 1.0) {
printf("tgamma/lgamma %6.3f: %20.13g %20.13g\n", x/3, tgamma(x/3.0), lgamma(x/3.0));
}
printf("tgamma/lgamma %g: %20.13g %20.13g\n", 0.00000234, tgamma(0.00000234), lgamma(0.00000234));
printf("log2, exp2, cbrt, cbrt: %.15g %.15g %.15g %.15g\n", log2(1024), exp2(10), cbrt(-10), cbrt(10));
}
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -31,13 +31,16 @@ tcc-doc.html
|
||||
tcc-doc.info
|
||||
|
||||
win32/doc
|
||||
win32/examples/libtcc_test.c
|
||||
win32/libtcc
|
||||
win32/lib/32
|
||||
win32/lib/64
|
||||
win32/include/float.h
|
||||
win32/include/stdalign.h
|
||||
win32/include/stdarg.h
|
||||
win32/include/stdbool.h
|
||||
win32/include/stddef.h
|
||||
win32/include/stdnoreturn.h
|
||||
win32/include/varargs.h
|
||||
win32/include/tcclib.h
|
||||
|
||||
|
||||
Reference in New Issue
Block a user