diff options
author | jofret | 2007-01-29 17:02:35 +0000 |
---|---|---|
committer | jofret | 2007-01-29 17:02:35 +0000 |
commit | 170334ed9128da4a2f916d88ba52db0988e1d119 (patch) | |
tree | b73d501433e15e52e04a6e6237b2e552e8da5da9 /src/test/testCosh.c | |
parent | c24d5795ea30345dee4cb5f308de7021ba0ef00b (diff) | |
download | scilab2c-170334ed9128da4a2f916d88ba52db0988e1d119.tar.gz scilab2c-170334ed9128da4a2f916d88ba52db0988e1d119.tar.bz2 scilab2c-170334ed9128da4a2f916d88ba52db0988e1d119.zip |
Need to have a clear answer about STDC99 for complex implementation !
Add som tests.
Diffstat (limited to 'src/test/testCosh.c')
-rw-r--r-- | src/test/testCosh.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/test/testCosh.c b/src/test/testCosh.c new file mode 100644 index 00000000..0efb9868 --- /dev/null +++ b/src/test/testCosh.c @@ -0,0 +1,56 @@ +/* +** -*- C -*- +** +** testCosh.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Dec 8 15:05:44 2006 jofret +** Last update Mon Jan 29 16:15:15 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include <stdio.h> + +#define PI 3.1415826535 + +float scoshs(float); +double dcoshs(double); + + +void scoshsTest() { + printf(">> Float scalar\n"); + printf("scoshs(0) = %f\n", scoshs((float) 0)); + printf("scoshs(PI) = %f\n", scoshs(PI)); + printf("scoshs(PI/2) = %f\n", scoshs(PI/2)); + printf("scoshs(PI/3) = %f\n", scoshs(PI/3)); + printf("scoshs(PI/4) = %f\n", scoshs(PI/4)); + printf("scoshs(PI/6) = %f\n", scoshs(PI/6)); + printf("scoshs(-PI) = %f\n", scoshs(-PI)); + printf("scoshs(-PI/2) = %f\n", scoshs(-PI/2)); + printf("scoshs(-PI/3) = %f\n", scoshs(-PI/3)); + printf("scoshs(-PI/4) = %f\n", scoshs(-PI/4)); + printf("scoshs(-PI/6) = %f\n", scoshs(-PI/6)); +} + +void dcoshsTest() { + printf(">> Double scalar\n"); + printf("dcoshs(0) = %e\n", dcoshs((double) 0)); + printf("dcoshs(PI) = %e\n", dcoshs(PI)); + printf("dcoshs(PI/2) = %e\n", dcoshs(PI/2)); + printf("dcoshs(PI/3) = %e\n", dcoshs(PI/3)); + printf("dcoshs(PI/4) = %e\n", dcoshs(PI/4)); + printf("dcoshs(PI/6) = %e\n", dcoshs(PI/6)); + printf("dcoshs(-PI) = %e\n", dcoshs(-PI)); + printf("dcoshs(-PI/2) = %e\n", dcoshs(-PI/2)); + printf("dcoshs(-PI/3) = %e\n", dcoshs(-PI/3)); + printf("dcoshs(-PI/4) = %e\n", dcoshs(-PI/4)); + printf("dcoshs(-PI/6) = %e\n", dcoshs(-PI/6)); +} + +int testCosh() { + printf(">>>> Hyperbolic Cosine Tests\n"); + scoshsTest(); + dcoshsTest(); + return 0; +} |