;;;; mathh-test (require-extension test) (require-extension mathh) (include "mathh-constants") (test-group "ISO C Functions" (test 1.0 (bessel-j0 0.0)) (test 0.0 (bessel-j1 0.0)) (test 1.0 (bessel-jn 0 0.0)) (test 0.0 (bessel-jn 1 0.0)) (test 0.088256964215677 (bessel-y0 1.0)) (test -0.781212821300289 (bessel-y1 1.0)) (test 0.088256964215677 (bessel-yn 0 1.0)) (test -0.781212821300289 (bessel-yn 1 1.0)) (test 1.0 (cosh 0.0)) (test 0.0 (sinh 0.0)) (test 0.0 (tanh 0.0)) (test 5.0 (hypot -5.0 0)) (test 1.0 (tgamma 1.0)) (test 0.0 (lgamma 1.0)) (test 2.0 (log10 100.0)) (test 3.0 (log2 8.0)) (test 0.0 (log1p 0.0)) (test 0.0 (fpmod 0.0 1.0)) (test (values 5.0 0.5) (modf 5.5)) (test 20.0 (ldexp 5.0 2)) (test 20.0 (scalbn 5.0 2)) (test (values 0.536870912 -30) (frexp 5.0e-10)) ) (test-group "Math Constants" ; Well, some (test SQRT2 (sqrt 2.0)) (test DEGREE (/ PI 180.0)) (test LN2 (log 2.0)) (test LOG2E (log2 E)) ) (test-group "Function fpclass" (test 'negative-infinite (fpclass -inf.0)) (test 'signaling-nan (fpclass -nan.0)) (test 'negative-zero (fpclass -0.0)) (test 'positive-normal (fpclass 0.741573033707865)) (test 'positive-normal (fpclass (fp/ 33.0 44.5))) ) (test-group "Function fpclassify" (test 'infinite (fpclassify -inf.0)) (test 'nan (fpclassify -nan.0)) (test 'zero (fpclassify -0.0)) (test 'normal (fpclassify 0.741573033707865)) (test 'normal (fpclassify (fp/ 33.0 44.5))) )