mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-30 04:33:17 +00:00
Add headers, documentation, and tests for tgamma().
This commit is contained in:
parent
a87aeef25b
commit
7d3f1c8dd7
@ -227,6 +227,9 @@ long double tanl(long double);
|
||||
double tanh(double);
|
||||
float tanhf(float);
|
||||
long double tanhl(long double);
|
||||
double tgamma(double);
|
||||
float tgammaf(float);
|
||||
long double tgammal(long double);
|
||||
double trunc(double);
|
||||
float truncf(float);
|
||||
long double truncl(long double);
|
||||
|
@ -86,6 +86,7 @@
|
||||
#define sqrt(x) __tg_x(sqrt,(x))
|
||||
#define tan(x) __tg_x(tan,(x))
|
||||
#define tanh(x) __tg_x(tanh,(x))
|
||||
#define tgamma(x) __tg_real_x(tgamma,(x))
|
||||
#define trunc(x) __tg_real_x(trunc,(x))
|
||||
|
||||
#endif
|
||||
|
@ -356,6 +356,22 @@ int main(void) {
|
||||
expect_approx(erfcl(0.95L), 1.791091927267220e-01L);
|
||||
expect_approx(erfcl(9.99L), 2.553157649309533e-45L);
|
||||
expect_approx(erfcl(105.0L), 4.300838032791244e-4791L);
|
||||
|
||||
expect_pole_error(tgamma(+0.0), +INFINITY);
|
||||
expect_pole_error(tgammaf(-0.0), -INFINITY);
|
||||
expect_domain_error(tgammal(-2.0));
|
||||
expect_domain_error(tgammal(-15.0));
|
||||
expect_domain_error(tgammal(-1e4900));
|
||||
expect_domain_error(tgammal(-INFINITY));
|
||||
expect_exact(tgammal(+INFINITY),+INFINITY);
|
||||
expect_approx(tgammal(1.0), 1.0);
|
||||
expect_approx(tgammal(6.0), 120.0);
|
||||
expect_approx(tgammal(19.5), 2.77243229863337182e+16L);
|
||||
expect_approx(tgammal(1755.0), 1.979261890105010e+4930L);
|
||||
expect_approx(tgammal(1e-4932L), 1e4932L);
|
||||
expect_approx(tgammal(-0.75), -4.83414654429587774L);
|
||||
expect_approx(tgammal(-50.00001L), -3.2878204666630031e-60L);
|
||||
expect_approx(tgammal(-1753.75L), 1.452754458037161e-4929L);
|
||||
|
||||
expect_exact(ceil(+0.0), +0.0);
|
||||
expect_exact(ceilf(-0.0), -0.0);
|
||||
|
7
cc.notes
7
cc.notes
@ -1322,6 +1322,13 @@ long double scalblnl(long double x, long n);
|
||||
|
||||
These functions return x * FLT_RADIX^n, computed efficiently. In ORCA/C, FLT_RADIX is 2.
|
||||
|
||||
#include <math.h>
|
||||
double tgamma(double x);
|
||||
float tgammaf(float x);
|
||||
long double tgammal(long double x);
|
||||
|
||||
These functions compute the gamma function of x.
|
||||
|
||||
#include <math.h>
|
||||
double trunc(double x);
|
||||
float truncf(float x);
|
||||
|
Loading…
x
Reference in New Issue
Block a user