diff options
author | Ulrich Drepper <drepper@redhat.com> | 1997-04-12 23:41:36 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1997-04-12 23:41:36 +0000 |
commit | 6355131153fd618d50286f0f24ac49b405d03ee5 (patch) | |
tree | 4927449e56ae721b2ddb0d42efcce211b6068004 /math/libm-test.c | |
parent | c131718ccc1db101df54fb04f34f5611c3678450 (diff) | |
download | glibc-6355131153fd618d50286f0f24ac49b405d03ee5.tar.gz glibc-6355131153fd618d50286f0f24ac49b405d03ee5.tar.xz glibc-6355131153fd618d50286f0f24ac49b405d03ee5.zip |
Update.
1997-04-13 01:06 Ulrich Drepper <drepper@cygnus.com> * isomac.c: Improve messages. * math/Makefile (libm-calls): Add s_nearbyint, s_catan, s_casin, s_ccos, s_csin, s_ctan, s_ctanh, s_cacos, s_casinh, s_cacosh, s_catanh, s_csqrt, and s_cpow. * math/libm-test.c: New functions ccos_test, cacos_test, cacosh_test, casin_test, casinh_test, catan_test, catanh_test, ctanh_test, csqrt_test, cpow_test, rint_test. * math/math.h: Include new header mathbits.h which defines some more (system dependent) types and some macros. (isfinite): Use __finite instead of fpclassify. * sysdeps/generic/mathbits.h: New file. * sysdeps/i386/fpu/mathbits.h: New file. * sysdeps/i386/huge_val.h: Don't define INFINITY. * sysdeps/ieee754/huge_val.h: Likewise. * sysdeps/m68k/huge_val.h: Likewise. * sysdeps/i386/fpu/fenvbits.h: Define FE_NOMASK_ENV. * sysdeps/i386/fpu/fesetenv.c: Handle FE_NOMASK_ENV. * math/complex.h (_Imaginary_I): Define correctly. I misread the standard first. * sysdeps/libm-i387/s_finite.S: Optimized rewrite. * sysdeps/libm-i387/s_finitef.S: Likewise. * sysdeps/libm-i387/s_finitel.S: Likewise. Provided by Joe Keane <jgk@jgk.org>. * sysdeps/libm-i387/s_nearbyint.S: New file. * sysdeps/libm-i387/s_nearbyintf.S: New file. * sysdeps/libm-i387/s_nearbyintl.S: New file. * sysdeps/libm-ieee754/s_nearbyint.S: New file. * sysdeps/libm-ieee754/s_nearbyintf.S: New file. * sysdeps/libm-ieee754/s_nearbyintl.S: New file. * sysdeps/libm-ieee754/s_cacos.c: New file. * sysdeps/libm-ieee754/s_cacosf.c: New file. * sysdeps/libm-ieee754/s_cacosl.c: New file. * sysdeps/libm-ieee754/s_cacosh.c: New file. * sysdeps/libm-ieee754/s_cacoshf.c: New file. * sysdeps/libm-ieee754/s_cacoshl.c: New file. * sysdeps/libm-ieee754/s_casin.c: New file. * sysdeps/libm-ieee754/s_casinf.c: New file. * sysdeps/libm-ieee754/s_casinl.c: New file. * sysdeps/libm-ieee754/s_casinh.c: New file. * sysdeps/libm-ieee754/s_casinhf.c: New file. * sysdeps/libm-ieee754/s_casinhl.c: New file. * sysdeps/libm-ieee754/s_catan.c: New file. * sysdeps/libm-ieee754/s_catanf.c: New file. * sysdeps/libm-ieee754/s_catanl.c: New file. * sysdeps/libm-ieee754/s_catanh.c: New file. * sysdeps/libm-ieee754/s_catanhf.c: New file. * sysdeps/libm-ieee754/s_catanhl.c: New file. * sysdeps/libm-ieee754/s_ccos.c: New file. * sysdeps/libm-ieee754/s_ccosf.c: New file. * sysdeps/libm-ieee754/s_ccosl.c: New file. * sysdeps/libm-ieee754/s_cpow.c: New file. * sysdeps/libm-ieee754/s_cpowf.c: New file. * sysdeps/libm-ieee754/s_cpowl.c: New file. * sysdeps/libm-ieee754/s_csin.c: New file. * sysdeps/libm-ieee754/s_csinf.c: New file. * sysdeps/libm-ieee754/s_csinl.c: New file. * sysdeps/libm-ieee754/s_csqrt.c: New file. * sysdeps/libm-ieee754/s_csqrtf.c: New file. * sysdeps/libm-ieee754/s_csqrtl.c: New file. * sysdeps/libm-ieee754/s_ctan.c: New file. * sysdeps/libm-ieee754/s_ctanf.c: New file. * sysdeps/libm-ieee754/s_ctanl.c: New file. * sysdeps/libm-ieee754/s_ctanh.c: New file. * sysdeps/libm-ieee754/s_ctanhf.c: New file. * sysdeps/libm-ieee754/s_ctanhl.c: New file. * time/strftime.c (memset_space): Increment pointer. * time/strptime.c: Interpret year number 00-59 as 2000--2059. Patches by Karl Heuer <kwzh@gnu.ai.mit.edu>. 1997-04-11 11:57 Miguel de Icaza <miguel@nuclecu.unam.mx> * sysdeps/unix/sysv/linux/sparc/syscalls.list: Remove fork, pipe, syscall. 1997-04-05 00:57 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/libm-ieee754/s_remquo.c: Change algorithm, although probably still wrong. * sysdeps/libm-ieee754/s_remquof.c: Likewise. * sysdeps/libm-ieee754/s_remquol.c: Likewise. * math/libm-test.c (remquo_test): Corrected. 1997-04-11 00:01 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/fpu/__math.h (__rinttol, rinttol): New inline. * sysdeps/m68k/fpu/s_rinttol.c: New file. * sysdeps/m68k/fpu/s_rinttoll.c: New file. * math/libm-test.c (remquo_test): Use check_long to test the quotient. (cbrt_test): Add epsilons for long double. 1997-04-10 18:48 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * locale/localeinfo.h: Update declaration of _nl_current. 1997-04-11 11:27 Ulrich Drepper <drepper@cygnus.com> * rellnsh-sh: Use explicitely /bin/pwd to find the external program. * math/Makefile (headers): Add fenv.h and fenvbits.h. (libm-support): Add s_rountol, s_roundtoll, fclrexcpt, fgetexcptflg, fraiseexcpt, fsetexcptflg, ftestexcept, fegetround, fesetround, fegetenv, feholdexcpt, fesetenv, feupdateenv. (libm-calls): Add s_round. * math/fenv.h: New file. * math/libm-test.c: Correct tests for s_rinttol and s_rinttoll. Add roundtol_check and roundtoll_check. * math/math.h: Pretty printing. * sysdeps/i386/fpu/fclrexcpt.c: New file. * sysdeps/i386/fpu/fegetenv.c: New file. * sysdeps/i386/fpu/fegetround.c: New file. * sysdeps/i386/fpu/feholdexcpt.c: New file. * sysdeps/i386/fpu/fenvbits.h: New file. * sysdeps/i386/fpu/fesetenv.c: New file. * sysdeps/i386/fpu/fesetround.c: New file. * sysdeps/i386/fpu/fgetexcptflg.c: New file. * sysdeps/i386/fpu/fraiseexcpt.c: New file. * sysdeps/i386/fpu/fsetexcptflg.c: New file. * sysdeps/i386/fpu/ftestexcept.c: New file. * sysdeps/stub/fclrexcpt.c: New file. * sysdeps/stub/fegetenv.c: New file. * sysdeps/stub/fegetround.c: New file. * sysdeps/stub/feholdexcpt.c: New file. * sysdeps/stub/fenvbits.h: New file. * sysdeps/stub/fesetenv.c: New file. * sysdeps/stub/fesetround.c: New file. * sysdeps/stub/fgetexcptflg.c: New file. * sysdeps/stub/fraiseexcpt.c: New file. * sysdeps/stub/fsetexcptflg.c: New file. * sysdeps/stub/ftestexcept.c: New file. * sysdeps/libm-i387/s_trunc.S: New file. * sysdeps/libm-i387/s_truncf.S: New file. * sysdeps/libm-i387/s_truncl.S: New file. * sysdeps/libm-ieee754/s_round.c: New file. * sysdeps/libm-ieee754/s_roundf.c: New file. * sysdeps/libm-ieee754/s_roundl.c: New file. * sysdeps/libm-ieee754/s_ccosh.c: Rewritten to use fpclassify. * sysdeps/libm-ieee754/s_ccoshf.c: Likewise. * sysdeps/libm-ieee754/s_ccoshl.c: Likewise. * sysdeps/libm-ieee754/s_cexp.c: Likewise. * sysdeps/libm-ieee754/s_cexpf.c: Likewise. * sysdeps/libm-ieee754/s_cexpl.c: Likewise. * sysdeps/libm-ieee754/s_clog.c: Likewise. * sysdeps/libm-ieee754/s_clogf.c: Likewise. * sysdeps/libm-ieee754/s_clogl.c: Likewise. * sysdeps/libm-ieee754/s_csinh.c. Likewise. * sysdeps/libm-ieee754/s_csinhf.c. Likewise. * sysdeps/libm-ieee754/s_csinhl.c. Likewise. * sysdeps/libm-ieee754/s_ceill.c: Corrected. The mantissa has only 63 bits. * sysdeps/libm-ieee754/s_floorl.c: Likewise. * po/pl.po: Updated. * string/swab.c: Correctly handle array of odd length. * sysdeps/generic/memmem.c: Update copyright. 1997-04-10 20:22 Ulrich Drepper <drepper@cygnus.com> * hurd/Makefile (sunrpc-headers): Add clnt.h. Proposed by Thomas Bushnell <thomas@gnu.ai.mit.edu>. 1997-04-09 14:21 Miguel de Icaza <miguel@nuclecu.unam.mx> * sysdeps/sparc/dl-machine.h: Bug fix: I was not loading the proper value from the GOT. Pass argument block to init function. * sysdeps/sparc/elf/start.c: Call atexit (_fini) after calling _init (). * sysdeps/sparc/fpu_control.h: Fix the FPU constants. I got them wrong the first time. * sysdeps/sparc/setjmp.S: PIC code was clobbering a callee saved register. * sysdeps/sparc/udiv_qrnnd.S: Add type @function. * sysdeps/unix/sysv/linux/sparc/init-first.h: Linux/SPARC specific SYSDEP_CALL_INIT. * sysdeps/unix/sysv/linux/sparc/signum.h: Remove definition for NSIG and duplicated SIGIOT. 1997-04-05 00:57 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/libm-ieee754/s_remquo.c: Change algorithm, although probably still wrong. * sysdeps/libm-ieee754/s_remquof.c: Likewise. * sysdeps/libm-ieee754/s_remquol.c: Likewise. * math/libm-test.c (remquo_test): Corrected. 1997-04-03 18:35 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makefile (parent-tests): New target to run the tests to that they are executed even if some subdir tests have failed. (tests): Depend on parent-tests instead of running the tests directly. 1997-04-03 12:26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> Clean up name space pollution in libnss_*.so: * nis/nss_compat/compat-pwd.c, resolv/mapv4v6addr.h, resolv/nss_dns/dns-host.c: Replace bzero by memset, bcopy by memcpy and bcmp by memcmp to clean up namespace. * nss/nss_db/db-XXX.c (internal_setent): Use __dbopen instead of dbopen. * nss/nss_db/db-alias.c (internal_setent): Likewise. * nss/nss_db/db-netgrp.c (_nss_db_setnetgrent): Likewise. * db/db/db.c [_LIBC]: Define __dbopen instead of dbopen and make the latter a weak alias. * db/db.h: Declare __dbopen. * db/btree/btree.h [_LIBC]: Prepend __ to all mpool functions. * db/mpool/mpool.c [_LIBC]: Define all external functions with __ prefix and make the old names weak aliases. * db/mpool.h: Declare the new internal names. 1997-04-04 23:57 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * stdio-common/vfscanf.c: Fix scanning of hexadecimal fp number. * stdio-common/tstscanf.c: Add test case for this. 1997-04-04 17:26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * math/libm-test.c: Fix more typos. 1997-04-03 17:15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * math/libm-test.c (csinh_test): Fix test names. (ccosh_test): Likewise. * sysdeps/libm-ieee754/s_csinh.c: Use sinh function instead of computing it directly. * sysdeps/libm-ieee754/s_csinhf.c: Likewise. * sysdeps/libm-ieee754/s_csinhl.c: Likewise. * sysdeps/libm-ieee754/s_ccosh.c: Use cosh function instead of computing it directly. * sysdeps/libm-ieee754/s_ccoshf.c: Likewise. * sysdeps/libm-ieee754/s_ccoshl.c: Likewise. * sysdeps/libm-ieee754/s_cexp.c: Use internal exp function instead of wrapper. * sysdeps/libm-ieee754/s_cexpf.c: Likewise. * sysdeps/libm-ieee754/s_cexpl.c: Likewise. * sysdeps/m68k/fpu/s_cexp.c: Likewise. Correct handling of special values. Avoid use of fsincos if all that is needed is the quadrant. * sysdeps/m68k/fpu/s_ccosh.c: New file. * sysdeps/m68k/fpu/s_ccoshf.c: New file. * sysdeps/m68k/fpu/s_ccoshl.c: New file. * sysdeps/m68k/fpu/s_csinh.c: New file. * sysdeps/m68k/fpu/s_csinhl.c: New file. * sysdeps/m68k/fpu/s_csinhf.c: New file. 1997-04-03 10:18 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * manual/Makefile (dir-add.texi): Simplify. * libio/genops.c (_IO_flush_all_linebuffered): Don't flush on
Diffstat (limited to 'math/libm-test.c')
-rw-r--r-- | math/libm-test.c | 635 |
1 files changed, 562 insertions, 73 deletions
diff --git a/math/libm-test.c b/math/libm-test.c index 5171d0fc5e..356cc91a16 100644 --- a/math/libm-test.c +++ b/math/libm-test.c @@ -633,8 +633,9 @@ cbrt_test (void) check_isinfn ("cbrt (-inf) == -inf", FUNC(cbrt) (minus_infty)); check_isnan ("cbrt (NaN) == NaN", FUNC(cbrt) (nan_value)); - check ("cbrt (8) == 2", FUNC(cbrt) (8), 2); - check ("cbrt (-27) == -3", FUNC(cbrt) (-27.0), -3.0); + check_eps ("cbrt (8) == 2", FUNC(cbrt) (8), 2, CHOOSE (5e-17L, 0, 0)); + check_eps ("cbrt (-27) == -3", FUNC(cbrt) (-27.0), -3.0, + CHOOSE (3e-16L, 0, 0)); } @@ -1573,19 +1574,19 @@ remquo_test (void) result = FUNC(remquo) (1.625, 1.0, &quo); check ("remquo(1.625, 1.0, &x) == -0.375", result, -0.375); - check ("remquo(1.625, 1.0, &x) puts 1 in x", quo, 1); + check_long ("remquo(1.625, 1.0, &x) puts 1 in x", quo, 1); result = FUNC(remquo) (-1.625, 1.0, &quo); check ("remquo(-1.625, 1.0, &x) == 0.375", result, 0.375); - check ("remquo(-1.625, 1.0, &x) puts -1 in x", quo, -1); + check_long ("remquo(-1.625, 1.0, &x) puts -1 in x", quo, -1); result = FUNC(remquo) (1.625, -1.0, &quo); - check ("remquo(1.125, -1.0, &x) == 0.125", result, 0.125); - check ("remquo(1.125, -1.0, &x) puts -1 in x", quo, -1); + check ("remquo(1.625, -1.0, &x) == -0.375", result, -0.375); + check_long ("remquo(1.625, -1.0, &x) puts -1 in x", quo, -1); result = FUNC(remquo) (-1.625, -1.0, &quo); - check ("remquo(-1.125, -1.0, &x) == 0.125", result, 0.125); - check ("remquo(-1.125, -1.0, &x) puts 1 in x", quo, 1); + check ("remquo(-1.625, -1.0, &x) == 0.375", result, 0.375); + check_long ("remquo(-1.625, -1.0, &x) puts 1 in x", quo, 1); } @@ -1667,10 +1668,10 @@ cexp_test (void) result = FUNC(cexp) (BUILD_COMPLEX (nan_value, 1.0)); check_isnan ("real(cexp(NaN + 1i)) = NaN", __real__ result); check_isnan ("imag(cexp(NaN + 1i)) = NaN", __imag__ result); - result = FUNC(cexp) (BUILD_COMPLEX (nan_value, 1.0)); + result = FUNC(cexp) (BUILD_COMPLEX (nan_value, plus_infty)); check_isnan ("real(cexp(NaN + i inf)) = NaN", __real__ result); check_isnan ("imag(cexp(NaN + i inf)) = NaN", __imag__ result); - result = FUNC(cexp) (BUILD_COMPLEX (nan_value, 1.0)); + result = FUNC(cexp) (BUILD_COMPLEX (nan_value, nan_value)); check_isnan ("real(cexp(NaN + i NaN)) = NaN", __real__ result); check_isnan ("imag(cexp(NaN + i NaN)) = NaN", __imag__ result); @@ -1702,16 +1703,16 @@ csinh_test (void) check ("imag(csinh(-0 - 0i)) = -0", __imag__ result, minus_zero); result = FUNC(csinh) (BUILD_COMPLEX (0.0, plus_infty)); - check ("real(csinh(0 + i Inf)) = 0", FUNC(fabs) (__real__ result), 0); + check ("real(csinh(0 + i Inf)) = +-0", FUNC(fabs) (__real__ result), 0); check_isnan ("imag(csinh(0 + i Inf)) = NaN", __imag__ result); result = FUNC(csinh) (BUILD_COMPLEX (minus_zero, plus_infty)); - check ("real(csinh(-0 + i Inf)) = -0", FUNC(fabs) (__real__ result), 0); + check ("real(csinh(-0 + i Inf)) = +-0", FUNC(fabs) (__real__ result), 0); check_isnan ("imag(csinh(-0 + i Inf)) = NaN", __imag__ result); result = FUNC(csinh) (BUILD_COMPLEX (0.0, minus_infty)); - check ("real(csinh(0 - i Inf)) = 0", FUNC(fabs) (__real__ result), 0); + check ("real(csinh(0 - i Inf)) = +-0", FUNC(fabs) (__real__ result), 0); check_isnan ("imag(csinh(0 - i Inf)) = NaN", __imag__ result); result = FUNC(csinh) (BUILD_COMPLEX (minus_zero, minus_infty)); - check ("real(csinh(-0 - i Inf)) = -0", FUNC(fabs) (__real__ result), 0); + check ("real(csinh(-0 - i Inf)) = +-0", FUNC(fabs) (__real__ result), 0); check_isnan ("imag(csinh(-0 - i Inf)) = NaN", __imag__ result); result = FUNC(csinh) (BUILD_COMPLEX (plus_infty, 0.0)); @@ -1740,7 +1741,7 @@ csinh_test (void) FUNC(fabs) (__real__ result)); check_isnan ("imag(csinh(Inf - i Inf)) = NaN", __imag__ result); result = FUNC(csinh) (BUILD_COMPLEX (minus_infty, minus_infty)); - check_isinfp ("real(csinh(-Inf - i Inf)) = -Inf", + check_isinfp ("real(csinh(-Inf - i Inf)) = +-Inf", FUNC(fabs) (__real__ result)); check_isnan ("imag(csinh(-Inf - i Inf)) = NaN", __imag__ result); @@ -1771,10 +1772,10 @@ csinh_test (void) check_isnan ("imag(csinh(-6.75 - i Inf)) = NaN", __imag__ result); result = FUNC(csinh) (BUILD_COMPLEX (0.0, nan_value)); - check ("real(csinh(0 + i NaN)) = 0", FUNC(fabs) (__real__ result), 0); + check ("real(csinh(0 + i NaN)) = +-0", FUNC(fabs) (__real__ result), 0); check_isnan ("imag(csinh(0 + i NaN)) = NaN", __imag__ result); result = FUNC(csinh) (BUILD_COMPLEX (minus_zero, nan_value)); - check ("real(csinh(-0 + i NaN)) = -0", FUNC(fabs) (__real__ result), 0); + check ("real(csinh(-0 + i NaN)) = +-0", FUNC(fabs) (__real__ result), 0); check_isnan ("imag(csinh(-0 + i NaN)) = NaN", __imag__ result); result = FUNC(csinh) (BUILD_COMPLEX (plus_infty, nan_value)); @@ -1784,7 +1785,7 @@ csinh_test (void) result = FUNC(csinh) (BUILD_COMPLEX (minus_infty, nan_value)); check_isinfp ("real(csinh(-Inf + i NaN)) = +-Inf", FUNC(fabs) (__real__ result)); - check_isnan ("imag(csinh(-0 + i NaN)) = NaN", __imag__ result); + check_isnan ("imag(csinh(-Inf + i NaN)) = NaN", __imag__ result); result = FUNC(csinh) (BUILD_COMPLEX (9.0, nan_value)); check_isnan ("real(csinh(9.0 + i NaN)) = NaN", __real__ result); @@ -1795,10 +1796,10 @@ csinh_test (void) result = FUNC(csinh) (BUILD_COMPLEX (nan_value, 0.0)); check_isnan ("real(csinh(NaN + i0)) = NaN", __real__ result); - check ("imag(csinh(NaN + i0)) = NaN", __imag__ result, 0.0); + check ("imag(csinh(NaN + i0)) = 0", __imag__ result, 0.0); result = FUNC(csinh) (BUILD_COMPLEX (nan_value, minus_zero)); check_isnan ("real(csinh(NaN - i0)) = NaN", __real__ result); - check ("imag(csinh(NaN - i0)) = NaN", __imag__ result, minus_zero); + check ("imag(csinh(NaN - i0)) = -0", __imag__ result, minus_zero); result = FUNC(csinh) (BUILD_COMPLEX (nan_value, 10.0)); check_isnan ("real(csinh(NaN + i10)) = NaN", __real__ result); @@ -1821,21 +1822,152 @@ csinh_test (void) static void +ccos_test (void) +{ + __complex__ MATHTYPE result; + + result = FUNC(ccos) (BUILD_COMPLEX (0.0, 0.0)); + check ("real(ccos(0 + 0i)) = 1.0", __real__ result, 1.0); + check ("imag(ccos(0 + 0i)) = 0", __imag__ result, 0); + result = FUNC(ccos) (BUILD_COMPLEX (minus_zero, 0.0)); + check ("real(ccos(-0 + 0i)) = 1.0", __real__ result, 1.0); + check ("imag(ccos(-0 + 0i)) = -0", __imag__ result, minus_zero); + result = FUNC(ccos) (BUILD_COMPLEX (0.0, minus_zero)); + check ("real(ccos(0 - 0i)) = 1.0", __real__ result, 1.0); + check ("imag(ccos(0 - 0i)) = 0", __imag__ result, 0.0); + result = FUNC(ccos) (BUILD_COMPLEX (minus_zero, minus_zero)); + check ("real(ccos(-0 - 0i)) = 1.0", __real__ result, 1.0); + check ("imag(ccos(-0 - 0i)) = -0", __imag__ result, minus_zero); + + result = FUNC(ccos) (BUILD_COMPLEX (plus_infty, 0.0)); + check_isnan ("real(ccos(+Inf + i0)) = NaN", __real__ result); + check ("imag(ccos(Inf + i0)) = +-0", FUNC(fabs) (__imag__ result), 0); + result = FUNC(ccos) (BUILD_COMPLEX (plus_infty, minus_zero)); + check_isnan ("real(ccos(Inf - i0)) = NaN", __real__ result); + check ("imag(ccos(Inf - i0)) = +-0", FUNC(fabs) (__imag__ result), 0); + result = FUNC(ccos) (BUILD_COMPLEX (minus_infty, 0.0)); + check_isnan ("real(ccos(-Inf + i0)) = NaN", __real__ result); + check ("imag(ccos(-Inf + i0)) = +-0", FUNC(fabs) (__imag__ result), 0); + result = FUNC(ccos) (BUILD_COMPLEX (minus_infty, minus_zero)); + check_isnan ("real(ccos(-Inf - i0)) = NaN", __real__ result); + check ("imag(ccos(-Inf - i0)) = +-0", FUNC(fabs) (__imag__ result), 0); + + result = FUNC(ccos) (BUILD_COMPLEX (0.0, plus_infty)); + check_isinfp ("real(ccos(0 + i Inf)) = +Inf", __real__ result); + check ("imag(ccos(0 + i Inf)) = 0", __imag__ result, 0); + result = FUNC(ccos) (BUILD_COMPLEX (0.0, minus_infty)); + check_isinfp ("real(ccos(0 - i Inf)) = +Inf", __real__ result); + check ("imag(ccos(0 - i Inf)) = 0", __imag__ result, 0); + result = FUNC(ccos) (BUILD_COMPLEX (minus_zero, plus_infty)); + check_isinfp ("real(ccos(-0 + i Inf)) = +Inf", __real__ result); + check ("imag(ccos(-0 + i Inf)) = -0", __imag__ result, minus_zero); + result = FUNC(ccos) (BUILD_COMPLEX (minus_zero, minus_infty)); + check_isinfp ("real(ccos(-0 - i Inf)) = +Inf", __real__ result); + check ("imag(ccos(-0 - i Inf)) = -0", __imag__ result, minus_zero); + + result = FUNC(ccos) (BUILD_COMPLEX (plus_infty, plus_infty)); + check_isinfp ("real(ccos(+Inf + i Inf)) = +Inf", __real__ result); + check_isnan ("imag(ccos(+Inf + i Inf)) = NaN", __imag__ result); + result = FUNC(ccos) (BUILD_COMPLEX (minus_infty, plus_infty)); + check_isinfp ("real(ccos(-Inf + i Inf)) = +Inf", __real__ result); + check_isnan ("imag(ccos(-Inf + i Inf)) = NaN", __imag__ result); + result = FUNC(ccos) (BUILD_COMPLEX (plus_infty, minus_infty)); + check_isinfp ("real(ccos(Inf - i Inf)) = +Inf", __real__ result); + check_isnan ("imag(ccos(Inf - i Inf)) = NaN", __imag__ result); + result = FUNC(ccos) (BUILD_COMPLEX (minus_infty, minus_infty)); + check_isinfp ("real(ccos(-Inf - i Inf)) = +Inf", __real__ result); + check_isnan ("imag(ccos(-Inf - i Inf)) = NaN", __imag__ result); + + result = FUNC(ccos) (BUILD_COMPLEX (4.625, plus_infty)); + check_isinfn ("real(ccos(4.625 + i Inf)) = -Inf", __real__ result); + check_isinfn ("imag(ccos(4.625 + i Inf)) = -Inf", __imag__ result); + result = FUNC(ccos) (BUILD_COMPLEX (4.625, minus_infty)); + check_isinfn ("real(ccos(4.625 - i Inf)) = -Inf", __real__ result); + check_isinfn ("imag(ccos(4.625 - i Inf)) = -Inf", __imag__ result); + result = FUNC(ccos) (BUILD_COMPLEX (-4.625, plus_infty)); + check_isinfn ("real(ccos(-4.625 + i Inf)) = -Inf", __real__ result); + check_isinfp ("imag(ccos(-4.625 + i Inf)) = +Inf", __imag__ result); + result = FUNC(ccos) (BUILD_COMPLEX (-4.625, minus_infty)); + check_isinfn ("real(ccos(-4.625 - i Inf)) = -Inf", __real__ result); + check_isinfp ("imag(ccos(-4.625 - i Inf)) = +Inf", __imag__ result); + + result = FUNC(ccos) (BUILD_COMPLEX (plus_infty, 6.75)); + check_isnan ("real(ccos(+Inf + i6.75)) = NaN", __real__ result); + check_isnan ("imag(ccos(+Inf + i6.75)) = NaN", __imag__ result); + result = FUNC(ccos) (BUILD_COMPLEX (plus_infty, -6.75)); + check_isnan ("real(ccos(+Inf - i6.75)) = NaN", __real__ result); + check_isnan ("imag(ccos(+Inf - i6.75)) = NaN", __imag__ result); + result = FUNC(ccos) (BUILD_COMPLEX (minus_infty, 6.75)); + check_isnan ("real(ccos(-Inf + i6.75)) = NaN", __real__ result); + check_isnan ("imag(ccos(-Inf + i6.75)) = NaN", __imag__ result); + result = FUNC(ccos) (BUILD_COMPLEX (minus_infty, -6.75)); + check_isnan ("real(ccos(-Inf - i6.75)) = NaN", __real__ result); + check_isnan ("imag(ccos(-Inf - i6.75)) = NaN", __imag__ result); + + result = FUNC(ccos) (BUILD_COMPLEX (nan_value, 0.0)); + check_isnan ("real(ccos(NaN + i0)) = NaN", __real__ result); + check ("imag(ccos(NaN + i0)) = +-0", FUNC(fabs) (__imag__ result), 0); + result = FUNC(ccos) (BUILD_COMPLEX (nan_value, minus_zero)); + check_isnan ("real(ccos(NaN - i0)) = NaN", __real__ result); + check ("imag(ccos(NaN - i0)) = +-0", FUNC(fabs) (__imag__ result), 0); + + result = FUNC(ccos) (BUILD_COMPLEX (nan_value, plus_infty)); + check_isinfp ("real(ccos(NaN + i Inf)) = +Inf", __real__ result); + check_isnan ("imag(ccos(NaN + i Inf)) = NaN", __imag__ result); + result = FUNC(ccos) (BUILD_COMPLEX (nan_value, minus_infty)); + check_isinfp ("real(ccos(NaN - i Inf)) = +Inf", __real__ result); + check_isnan ("imag(ccos(NaN - i Inf)) = NaN", __imag__ result); + + result = FUNC(ccos) (BUILD_COMPLEX (nan_value, 9.0)); + check_isnan ("real(ccos(NaN + i9.0)) = NaN", __real__ result); + check_isnan ("imag(ccos(NaN + i9.0)) = NaN", __imag__ result); + result = FUNC(ccos) (BUILD_COMPLEX (nan_value, -9.0)); + check_isnan ("real(ccos(NaN - i9.0)) = NaN", __real__ result); + check_isnan ("imag(ccos(NaN - i9.0)) = NaN", __imag__ result); + + result = FUNC(ccos) (BUILD_COMPLEX (0.0, nan_value)); + check_isnan ("real(ccos(0 + i NaN)) = NaN", __real__ result); + check ("imag(ccos(0 + i NaN)) = +-0", FUNC(fabs) (__imag__ result), 0.0); + result = FUNC(ccos) (BUILD_COMPLEX (minus_zero, nan_value)); + check_isnan ("real(ccos(-0 + i NaN)) = NaN", __real__ result); + check ("imag(ccos(-0 + i NaN)) = +-0", FUNC(fabs) (__imag__ result), 0.0); + + result = FUNC(ccos) (BUILD_COMPLEX (10.0, nan_value)); + check_isnan ("real(ccos(10 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(ccos(10 + i NaN)) = NaN", __imag__ result); + result = FUNC(ccos) (BUILD_COMPLEX (-10.0, nan_value)); + check_isnan ("real(ccos(-10 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(ccos(-10 + i NaN)) = NaN", __imag__ result); + + result = FUNC(ccos) (BUILD_COMPLEX (plus_infty, nan_value)); + check_isnan ("real(ccos(+Inf + i NaN)) = NaN", __real__ result); + check_isnan ("imag(ccos(+Inf + i NaN)) = NaN", __imag__ result); + result = FUNC(ccos) (BUILD_COMPLEX (minus_infty, nan_value)); + check_isnan ("real(ccos(-Inf + i NaN)) = NaN", __real__ result); + check_isnan ("imag(ccos(-Inf + i NaN)) = NaN", __imag__ result); + + result = FUNC(ccos) (BUILD_COMPLEX (nan_value, nan_value)); + check_isnan ("real(ccos(NaN + i NaN)) = NaN", __real__ result); + check_isnan ("imag(ccos(NaN + i NaN)) = NaN", __imag__ result); +} + + +static void ccosh_test (void) { __complex__ MATHTYPE result; result = FUNC(ccosh) (BUILD_COMPLEX (0.0, 0.0)); - check ("real(ccosh(0 + 0i)) = 0", __real__ result, 1.0); + check ("real(ccosh(0 + 0i)) = 1.0", __real__ result, 1.0); check ("imag(ccosh(0 + 0i)) = 0", __imag__ result, 0); result = FUNC(ccosh) (BUILD_COMPLEX (minus_zero, 0.0)); - check ("real(ccosh(-0 + 0i)) = -0", __real__ result, 1.0); + check ("real(ccosh(-0 + 0i)) = 1.0", __real__ result, 1.0); check ("imag(ccosh(-0 + 0i)) = 0", __imag__ result, 0); result = FUNC(ccosh) (BUILD_COMPLEX (0.0, minus_zero)); - check ("real(ccosh(0 - 0i)) = 0", __real__ result, 1.0); + check ("real(ccosh(0 - 0i)) = 1.0", __real__ result, 1.0); check ("imag(ccosh(0 - 0i)) = -0", __imag__ result, minus_zero); result = FUNC(ccosh) (BUILD_COMPLEX (minus_zero, minus_zero)); - check ("real(ccosh(-0 - 0i)) = -0", __real__ result, 1.0); + check ("real(ccosh(-0 - 0i)) = 1.0", __real__ result, 1.0); check ("imag(ccosh(-0 - 0i)) = -0", __imag__ result, minus_zero); result = FUNC(ccosh) (BUILD_COMPLEX (0.0, plus_infty)); @@ -1843,13 +1975,13 @@ ccosh_test (void) check ("imag(ccosh(0 + i Inf)) = +-0", FUNC(fabs) (__imag__ result), 0); result = FUNC(ccosh) (BUILD_COMPLEX (minus_zero, plus_infty)); check_isnan ("real(ccosh(-0 + i Inf)) = NaN", __real__ result); - check ("imag(ccosh(-0 + i Inf)) = -0", FUNC(fabs) (__imag__ result), 0); + check ("imag(ccosh(-0 + i Inf)) = +-0", FUNC(fabs) (__imag__ result), 0); result = FUNC(ccosh) (BUILD_COMPLEX (0.0, minus_infty)); check_isnan ("real(ccosh(0 - i Inf)) = NaN", __real__ result); - check ("imag(ccosh(0 - i Inf)) = 0", FUNC(fabs) (__imag__ result), 0); + check ("imag(ccosh(0 - i Inf)) = +-0", FUNC(fabs) (__imag__ result), 0); result = FUNC(ccosh) (BUILD_COMPLEX (minus_zero, minus_infty)); check_isnan ("real(ccosh(-0 - i Inf)) = NaN", __real__ result); - check ("imag(ccosh(-0 - i Inf)) = -0", FUNC(fabs) (__imag__ result), 0); + check ("imag(ccosh(-0 - i Inf)) = +-0", FUNC(fabs) (__imag__ result), 0); result = FUNC(ccosh) (BUILD_COMPLEX (plus_infty, 0.0)); check_isinfp ("real(ccosh(+Inf + 0i)) = +Inf", __real__ result); @@ -1915,7 +2047,7 @@ ccosh_test (void) check_isnan ("imag(ccosh(+Inf + i NaN)) = NaN", __imag__ result); result = FUNC(ccosh) (BUILD_COMPLEX (minus_infty, nan_value)); check_isinfp ("real(ccosh(-Inf + i NaN)) = +Inf", __real__ result); - check_isnan ("imag(ccosh(-0 + i NaN)) = NaN", __imag__ result); + check_isnan ("imag(ccosh(-Inf + i NaN)) = NaN", __imag__ result); result = FUNC(ccosh) (BUILD_COMPLEX (9.0, nan_value)); check_isnan ("real(ccosh(9.0 + i NaN)) = NaN", __real__ result); @@ -1926,10 +2058,10 @@ ccosh_test (void) result = FUNC(ccosh) (BUILD_COMPLEX (nan_value, 0.0)); check_isnan ("real(ccosh(NaN + i0)) = NaN", __real__ result); - check ("imag(ccosh(NaN + i0)) = NaN", __imag__ result, 0.0); + check ("imag(ccosh(NaN + i0)) = +-0", FUNC(fabs) (__imag__ result), 0.0); result = FUNC(ccosh) (BUILD_COMPLEX (nan_value, minus_zero)); check_isnan ("real(ccosh(NaN - i0)) = NaN", __real__ result); - check ("imag(ccosh(NaN - i0)) = NaN", __imag__ result, minus_zero); + check ("imag(ccosh(NaN - i0)) = +-0", FUNC(fabs) (__imag__ result), 0.0); result = FUNC(ccosh) (BUILD_COMPLEX (nan_value, 10.0)); check_isnan ("real(ccosh(NaN + i10)) = NaN", __real__ result); @@ -1951,8 +2083,6 @@ ccosh_test (void) } -#if 0 -/* Enable these tests as soon as the functions are available. */ static void cacos_test (void) { @@ -2194,6 +2324,131 @@ cacosh_test (void) static void +casin_test (void) +{ + __complex__ MATHTYPE result; + + result = FUNC(casin) (BUILD_COMPLEX (0, 0)); + check ("real(casin(0 + i0)) = 0", __real__ result, 0); + check ("imag(casin(0 + i0)) = 0", __imag__ result, 0); + result = FUNC(casin) (BUILD_COMPLEX (minus_zero, 0)); + check ("real(casin(-0 + i0)) = -0", __real__ result, minus_zero); + check ("imag(casin(-0 + i0)) = 0", __imag__ result, 0); + result = FUNC(casin) (BUILD_COMPLEX (0, minus_zero)); + check ("real(casin(0 - i0)) = 0", __real__ result, 0); + check ("imag(casin(0 - i0)) = -0", __imag__ result, minus_zero); + result = FUNC(casin) (BUILD_COMPLEX (minus_zero, minus_zero)); + check ("real(casin(-0 - i0)) = -0", __real__ result, minus_zero); + check ("imag(casin(-0 - i0)) = -0", __imag__ result, minus_zero); + + result = FUNC(casin) (BUILD_COMPLEX (plus_infty, plus_infty)); + check ("real(casin(+Inf + i Inf)) = pi/4", __real__ result, M_PI_4); + check_isinfp ("imag(casin(+Inf + i Inf)) = +Inf", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (plus_infty, minus_infty)); + check ("real(casin(+Inf - i Inf)) = pi/4", __real__ result, M_PI_4); + check_isinfn ("imag(casin(+Inf - i Inf)) = -Inf", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (minus_infty, plus_infty)); + check ("real(casin(-Inf + i Inf)) = -pi/4", __real__ result, -M_PI_4); + check_isinfp ("imag(casin(-Inf + i Inf)) = +Inf", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (minus_infty, minus_infty)); + check ("real(casin(-Inf - i Inf)) = -pi/4", __real__ result, -M_PI_4); + check_isinfn ("imag(casin(-Inf - i Inf)) = -Inf", __imag__ result); + + result = FUNC(casin) (BUILD_COMPLEX (-10.0, plus_infty)); + check ("real(casin(-10.0 + i Inf)) = -0", __real__ result, minus_zero); + check_isinfp ("imag(casin(-10.0 + i Inf)) = +Inf", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (-10.0, minus_infty)); + check ("real(casin(-10.0 - i Inf)) = -0", __real__ result, minus_zero); + check_isinfn ("imag(casin(-10.0 - i Inf)) = -Inf", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (0, plus_infty)); + check ("real(casin(0 + i Inf)) = 0", __real__ result, 0.0); + check_isinfp ("imag(casin(0 + i Inf)) = +Inf", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (0, minus_infty)); + check ("real(casin(0 - i Inf)) = 0", __real__ result, 0.0); + check_isinfn ("imag(casin(0 - i Inf)) = -Inf", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (minus_zero, plus_infty)); + check ("real(casin(-0 + i Inf)) = -0", __real__ result, minus_zero); + check_isinfp ("imag(casin(-0 + i Inf)) = +Inf", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (minus_zero, minus_infty)); + check ("real(casin(-0 - i Inf)) = -0", __real__ result, minus_zero); + check_isinfn ("imag(casin(-0 - i Inf)) = -Inf", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (0.1, plus_infty)); + check ("real(casin(0.1 + i Inf)) = 0", __real__ result, 0); + check_isinfp ("imag(casin(0.1 + i Inf)) = +Inf", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (0.1, minus_infty)); + check ("real(casin(0.1 - i Inf)) = 0", __real__ result, 0); + check_isinfn ("imag(casin(0.1 - i Inf)) = -Inf", __imag__ result); + + result = FUNC(casin) (BUILD_COMPLEX (minus_infty, 0)); + check ("real(casin(-Inf + i0)) = -pi/2", __real__ result, -M_PI_2); + check_isinfp ("imag(casin(-Inf + i0)) = +Inf", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (minus_infty, minus_zero)); + check ("real(casin(-Inf - i0)) = -pi/2", __real__ result, -M_PI_2); + check_isinfn ("imag(casin(-Inf - i0)) = -Inf", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (minus_infty, 100)); + check ("real(casin(-Inf + i100)) = -pi/2", __real__ result, -M_PI_2); + check_isinfp ("imag(casin(-Inf + i100)) = +Inf", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (minus_infty, -100)); + check ("real(casin(-Inf - i100)) = -pi/2", __real__ result, -M_PI_2); + check_isinfn ("imag(casin(-Inf - i100)) = -Inf", __imag__ result); + + result = FUNC(casin) (BUILD_COMPLEX (plus_infty, 0)); + check ("real(casin(+Inf + i0)) = pi/2", __real__ result, M_PI_2); + check_isinfp ("imag(casin(+Inf + i0)) = +Inf", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (plus_infty, minus_zero)); + check ("real(casin(+Inf - i0)) = pi/2", __real__ result, M_PI_2); + check_isinfn ("imag(casin(+Inf - i0)) = -Inf", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (plus_infty, 0.5)); + check ("real(casin(+Inf + i0.5)) = pi/2", __real__ result, M_PI_2); + check_isinfp ("imag(casin(+Inf + i0.5)) = +Inf", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (plus_infty, -0.5)); + check ("real(casin(+Inf - i0.5)) = pi/2", __real__ result, M_PI_2); + check_isinfn ("imag(casin(+Inf - i0.5)) = -Inf", __imag__ result); + + result = FUNC(casin) (BUILD_COMPLEX (nan_value, plus_infty)); + check_isnan ("real(casin(NaN + i Inf)) = NaN", __real__ result); + check_isinfp ("imag(casin(NaN + i Inf)) = +Inf", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (nan_value, minus_infty)); + check_isnan ("real(casin(NaN - i Inf)) = NaN", __real__ result); + check_isinfn ("imag(casin(NaN - i Inf)) = -Inf", __imag__ result); + + result = FUNC(casin) (BUILD_COMPLEX (0.0, nan_value)); + check ("real(casin(0 + i NaN)) = 0", __real__ result, 0.0); + check_isnan ("imag(casin(0 + i NaN)) = NaN", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (minus_zero, nan_value)); + check ("real(casin(-0 + i NaN)) = -0", __real__ result, minus_zero); + check_isnan ("imag(casin(-0 + i NaN)) = NaN", __imag__ result); + + result = FUNC(casin) (BUILD_COMPLEX (plus_infty, nan_value)); + check_isnan ("real(casin(+Inf + i NaN)) = NaN", __real__ result); + check_isinfp ("imag(casin(+Inf + i NaN)) = +-Inf", + FUNC(fabs) (__imag__ result)); + result = FUNC(casin) (BUILD_COMPLEX (minus_infty, nan_value)); + check_isnan ("real(casin(-Inf + i NaN)) = NaN", __real__ result); + check_isinfp ("imag(casin(-Inf + NaN)) = +-Inf", + FUNC(fabs) (__imag__ result)); + + result = FUNC(casin) (BUILD_COMPLEX (nan_value, 10.5)); + check_isnan ("real(casin(NaN + i10.5)) = NaN", __real__ result); + check_isnan ("imag(casin(NaN + i10.5)) = NaN", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (nan_value, -10.5)); + check_isnan ("real(casin(NaN - i10.5)) = NaN", __real__ result); + check_isnan ("imag(casin(NaN - i10.5)) = NaN", __imag__ result); + + result = FUNC(casin) (BUILD_COMPLEX (0.75, nan_value)); + check_isnan ("real(casin(0.75 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(casin(0.75 + i NaN)) = NaN", __imag__ result); + result = FUNC(casin) (BUILD_COMPLEX (-0.75, nan_value)); + check_isnan ("real(casin(-0.75 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(casin(-0.75 + i NaN)) = NaN", __imag__ result); + + result = FUNC(casin) (BUILD_COMPLEX (nan_value, nan_value)); + check_isnan ("real(casin(NaN + i NaN)) = NaN", __real__ result); + check_isnan ("imag(casin(NaN + i NaN)) = NaN", __imag__ result); +} + + +static void casinh_test (void) { __complex__ MATHTYPE result; @@ -2236,6 +2491,12 @@ casinh_test (void) result = FUNC(casinh) (BUILD_COMPLEX (0, minus_infty)); check_isinfp ("real(casinh(0 - i Inf)) = +Inf", __real__ result); check ("imag(casinh(0 - i Inf)) = -pi/2", __imag__ result, -M_PI_2); + result = FUNC(casinh) (BUILD_COMPLEX (minus_zero, plus_infty)); + check_isinfn ("real(casinh(-0 + i Inf)) = -Inf", __real__ result); + check ("imag(casinh(-0 + i Inf)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(casinh) (BUILD_COMPLEX (minus_zero, minus_infty)); + check_isinfn ("real(casinh(-0 - i Inf)) = -Inf", __real__ result); + check ("imag(casinh(-0 - i Inf)) = -pi/2", __imag__ result, -M_PI_2); result = FUNC(casinh) (BUILD_COMPLEX (0.1, plus_infty)); check_isinfp ("real(casinh(0.1 + i Inf)) = +Inf", __real__ result); check ("imag(casinh(0.1 + i Inf)) = pi/2", __imag__ result, M_PI_2); @@ -2278,17 +2539,17 @@ casinh_test (void) result = FUNC(casinh) (BUILD_COMPLEX (nan_value, 0)); check_isnan ("real(casinh(NaN + i0)) = NaN", __real__ result); - check ("imag(casinh(NaN + i0)) = 0", __imag__ resul, 0); - result = FUNC(casinh) (BUILD_COMPLEX (minus_zero, nan_value)); + check ("imag(casinh(NaN + i0)) = 0", __imag__ result, 0); + result = FUNC(casinh) (BUILD_COMPLEX (nan_value, minus_zero)); check_isnan ("real(casinh(NaN - i0)) = NaN", __real__ result); check ("imag(casinh(NaN - i0)) = -0", __imag__ result, minus_zero); result = FUNC(casinh) (BUILD_COMPLEX (nan_value, plus_infty)); - check_isinfp ("real(casinh(NaN + i Inf)) = +Inf", + check_isinfp ("real(casinh(NaN + i Inf)) = +-Inf", FUNC(fabs) (__real__ result)); check_isnan ("imag(casinh(NaN + i Inf)) = NaN", __imag__ result); result = FUNC(casinh) (BUILD_COMPLEX (nan_value, minus_infty)); - check_isinfp ("real(casinh(NaN - i Inf)) = +Inf", + check_isinfp ("real(casinh(NaN - i Inf)) = +-Inf", FUNC(fabs) (__real__ result)); check_isnan ("imag(casinh(NaN - i Inf)) = NaN", __imag__ result); @@ -2302,7 +2563,7 @@ casinh_test (void) result = FUNC(casinh) (BUILD_COMPLEX (nan_value, 0.75)); check_isnan ("real(casinh(NaN + i0.75)) = NaN", __real__ result); check_isnan ("imag(casinh(NaN + i0.75)) = NaN", __imag__ result); - result = FUNC(casinh) (BUILD_COMPLEX (-10.5, nan_value)); + result = FUNC(casinh) (BUILD_COMPLEX (-0.75, nan_value)); check_isnan ("real(casinh(NaN - i0.75)) = NaN", __real__ result); check_isnan ("imag(casinh(NaN - i0.75)) = NaN", __imag__ result); @@ -2313,6 +2574,136 @@ casinh_test (void) static void +catan_test (void) +{ + __complex__ MATHTYPE result; + + result = FUNC(catan) (BUILD_COMPLEX (0, 0)); + check ("real(catan(0 + i0)) = 0", __real__ result, 0); + check ("imag(catan(0 + i0)) = 0", __imag__ result, 0); + result = FUNC(catan) (BUILD_COMPLEX (minus_zero, 0)); + check ("real(catan(-0 + i0)) = -0", __real__ result, minus_zero); + check ("imag(catan(-0 + i0)) = 0", __imag__ result, 0); + result = FUNC(catan) (BUILD_COMPLEX (0, minus_zero)); + check ("real(catan(0 - i0)) = 0", __real__ result, 0); + check ("imag(catan(0 - i0)) = -0", __imag__ result, minus_zero); + result = FUNC(catan) (BUILD_COMPLEX (minus_zero, minus_zero)); + check ("real(catan(-0 - i0)) = -0", __real__ result, minus_zero); + check ("imag(catan(-0 - i0)) = -0", __imag__ result, minus_zero); + + result = FUNC(catan) (BUILD_COMPLEX (plus_infty, plus_infty)); + check ("real(catan(+Inf + i Inf)) = pi/2", __real__ result, M_PI_2); + check ("imag(catan(+Inf + i Inf)) = 0", __imag__ result, 0); + result = FUNC(catan) (BUILD_COMPLEX (plus_infty, minus_infty)); + check ("real(catan(+Inf - i Inf)) = pi/2", __real__ result, M_PI_2); + check ("imag(catan(+Inf - i Inf)) = -0", __imag__ result, minus_zero); + result = FUNC(catan) (BUILD_COMPLEX (minus_infty, plus_infty)); + check ("real(catan(-Inf + i Inf)) = -pi/2", __real__ result, -M_PI_2); + check ("imag(catan(-Inf + i Inf)) = 0", __imag__ result, 0.0); + result = FUNC(catan) (BUILD_COMPLEX (minus_infty, minus_infty)); + check ("real(catan(-Inf - i Inf)) = -pi/2", __real__ result, -M_PI_2); + check ("imag(catan(-Inf - i Inf)) = -0", __imag__ result, minus_zero); + + result = FUNC(catan) (BUILD_COMPLEX (plus_infty, -10.0)); + check ("real(catan(+Inf - i10.0)) = pi/2", __real__ result, M_PI_2); + check ("imag(catan(+Inf - i10.0)) = -0", __imag__ result, minus_zero); + result = FUNC(catan) (BUILD_COMPLEX (minus_infty, -10.0)); + check ("real(catan(-Inf - i10.0)) = -pi/2", __real__ result, -M_PI_2); + check ("imag(catan(-Inf - i10.0)) = -0", __imag__ result, minus_zero); + result = FUNC(catan) (BUILD_COMPLEX (plus_infty, minus_zero)); + check ("real(catan(Inf - i0)) = pi/2", __real__ result, M_PI_2); + check ("imag(catan(Inf - i0)) = -0", __imag__ result, minus_zero); + result = FUNC(catan) (BUILD_COMPLEX (minus_infty, minus_zero)); + check ("real(catan(-Inf - i0)) = -pi/2", __real__ result, -M_PI_2); + check ("imag(catan(-Inf - i0)) = -0", __imag__ result, minus_zero); + result = FUNC(catan) (BUILD_COMPLEX (plus_infty, 0.0)); + check ("real(catan(Inf + i0)) = pi/2", __real__ result, M_PI_2); + check ("imag(catan(Inf + i0)) = 0", __imag__ result, 0.0); + result = FUNC(catan) (BUILD_COMPLEX (minus_infty, 0.0)); + check ("real(catan(-Inf + i0)) = -pi/2", __real__ result, -M_PI_2); + check ("imag(catan(-Inf + i0)) = 0", __imag__ result, 0.0); + result = FUNC(catan) (BUILD_COMPLEX (plus_infty, 0.1)); + check ("real(catan(+Inf + i0.1)) = pi/2", __real__ result, M_PI_2); + check ("imag(catan(+Inf + i0.1)) = 0", __imag__ result, 0); + result = FUNC(catan) (BUILD_COMPLEX (minus_infty, 0.1)); + check ("real(catan(-Inf + i0.1)) = -pi/2", __real__ result, -M_PI_2); + check ("imag(catan(-Inf + i0.1)) = 0", __imag__ result, 0); + + result = FUNC(catan) (BUILD_COMPLEX (0.0, minus_infty)); + check ("real(catan(0 - i Inf)) = pi/2", __real__ result, M_PI_2); + check ("imag(catan(0 - i Inf)) = -0", __imag__ result, minus_zero); + result = FUNC(catan) (BUILD_COMPLEX (minus_zero, minus_infty)); + check ("real(catan(-0 - i Inf)) = -pi/2", __real__ result, -M_PI_2); + check ("imag(catan(-0 - i Inf)) = -0", __imag__ result, minus_zero); + result = FUNC(catan) (BUILD_COMPLEX (100.0, minus_infty)); + check ("real(catan(100 - i Inf)) = pi/2", __real__ result, M_PI_2); + check ("imag(catan(100 - i Inf)) = -0", __imag__ result, minus_zero); + result = FUNC(catan) (BUILD_COMPLEX (-100.0, minus_infty)); + check ("real(catan(-100 - i Inf)) = -pi/2", __real__ result, -M_PI_2); + check ("imag(catan(-100 - i Inf)) = -0", __imag__ result, minus_zero); + + result = FUNC(catan) (BUILD_COMPLEX (0.0, plus_infty)); + check ("real(catan(0 + i Inf)) = pi/2", __real__ result, M_PI_2); + check ("imag(catan(0 + i Inf)) = 0", __imag__ result, 0); + result = FUNC(catan) (BUILD_COMPLEX (minus_zero, plus_infty)); + check ("real(catan(-0 + i Inf)) = -pi/2", __real__ result, -M_PI_2); + check ("imag(catan(-0 + i Inf)) = 0", __imag__ result, 0); + result = FUNC(catan) (BUILD_COMPLEX (0.5, plus_infty)); + check ("real(catan(0.5 + i Inf)) = pi/2", __real__ result, M_PI_2); + check ("imag(catan(0.5 + i Inf)) = 0", __imag__ result, 0); + result = FUNC(catan) (BUILD_COMPLEX (-0.5, plus_infty)); + check ("real(catan(-0.5 + i Inf)) = -pi/2", __real__ result, -M_PI_2); + check ("imag(catan(-0.5 + i Inf)) = 0", __imag__ result, 0); + + result = FUNC(catan) (BUILD_COMPLEX (nan_value, 0.0)); + check_isnan ("real(catan(NaN + i0)) = NaN", __real__ result); + check ("imag(catan(NaN + i0)) = 0", __imag__ result, 0.0); + result = FUNC(catan) (BUILD_COMPLEX (nan_value, minus_zero)); + check_isnan ("real(catan(NaN - i0)) = NaN", __real__ result); + check ("imag(catan(NaN - i0)) = -0", __imag__ result, minus_zero); + + result = FUNC(catan) (BUILD_COMPLEX (nan_value, plus_infty)); + check_isnan ("real(catan(NaN + i Inf)) = NaN", __real__ result); + check ("imag(catan(NaN + i Inf)) = 0", __imag__ result, 0); + result = FUNC(catan) (BUILD_COMPLEX (nan_value, minus_infty)); + check_isnan ("real(catan(NaN - i Inf)) = NaN", __real__ result); + check ("imag(catan(NaN - i Inf)) = -0", __imag__ result, minus_zero); + + result = FUNC(catan) (BUILD_COMPLEX (0.0, nan_value)); + check_isnan ("real(catan(0 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(catan(0 + i NaN)) = NaN", __imag__ result); + result = FUNC(catan) (BUILD_COMPLEX (minus_zero, nan_value)); + check_isnan ("real(catan(-0 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(catan(-0 + i NaN)) = NaN", __imag__ result); + + result = FUNC(catan) (BUILD_COMPLEX (plus_infty, nan_value)); + check ("real(catan(+Inf + i NaN)) = pi/2", __real__ result, M_PI_2); + check ("imag(catan(+Inf + i NaN)) = +-0", FUNC(fabs) (__imag__ result), 0); + result = FUNC(catan) (BUILD_COMPLEX (minus_infty, nan_value)); + check ("real(catan(-Inf + i NaN)) = -pi/2", __real__ result, -M_PI_2); + check ("imag(catan(-Inf + i NaN)) = +-0", FUNC(fabs) (__imag__ result), 0); + + result = FUNC(catan) (BUILD_COMPLEX (nan_value, 10.5)); + check_isnan ("real(catan(NaN + i10.5)) = NaN", __real__ result); + check_isnan ("imag(catan(NaN + i10.5)) = NaN", __imag__ result); + result = FUNC(catan) (BUILD_COMPLEX (nan_value, -10.5)); + check_isnan ("real(catan(NaN - i10.5)) = NaN", __real__ result); + check_isnan ("imag(catan(NaN - i10.5)) = NaN", __imag__ result); + + result = FUNC(catan) (BUILD_COMPLEX (0.75, nan_value)); + check_isnan ("real(catan(0.75 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(catan(0.75 + i NaN)) = NaN", __imag__ result); + result = FUNC(catan) (BUILD_COMPLEX (-0.75, nan_value)); + check_isnan ("real(catan(-0.75 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(catan(-0.75 + i NaN)) = NaN", __imag__ result); + + result = FUNC(catan) (BUILD_COMPLEX (nan_value, nan_value)); + check_isnan ("real(catan(NaN + i NaN)) = NaN", __real__ result); + check_isnan ("imag(catan(NaN + i NaN)) = NaN", __imag__ result); +} + + +static void catanh_test (void) { __complex__ MATHTYPE result; @@ -2344,11 +2735,17 @@ catanh_test (void) check ("imag(catanh(-Inf - i Inf)) = -pi/2", __imag__ result, -M_PI_2); result = FUNC(catanh) (BUILD_COMPLEX (-10.0, plus_infty)); - check ("real(catanh(-10.0 + i Inf)) = -0", __real__ result, -minus_zero); + check ("real(catanh(-10.0 + i Inf)) = -0", __real__ result, minus_zero); check ("imag(catanh(-10.0 + i Inf)) = pi/2", __imag__ result, M_PI_2); result = FUNC(catanh) (BUILD_COMPLEX (-10.0, minus_infty)); - check ("real(catanh(-10.0 - i Inf)) = -0", __real__ result, minus_infty); + check ("real(catanh(-10.0 - i Inf)) = -0", __real__ result, minus_zero); check ("imag(catanh(-10.0 - i Inf)) = -pi/2", __imag__ result, -M_PI_2); + result = FUNC(catanh) (BUILD_COMPLEX (minus_zero, plus_infty)); + check ("real(catanh(-0 + i Inf)) = -0", __real__ result, minus_zero); + check ("imag(catanh(-0 + i Inf)) = pi/2", __imag__ result, M_PI_2); + result = FUNC(catanh) (BUILD_COMPLEX (minus_zero, minus_infty)); + check ("real(catanh(-0 - i Inf)) = -0", __real__ result, minus_zero); + check ("imag(catanh(-0 - i Inf)) = -pi/2", __imag__ result, -M_PI_2); result = FUNC(catanh) (BUILD_COMPLEX (0, plus_infty)); check ("real(catanh(0 + i Inf)) = 0", __real__ result, 0); check ("imag(catanh(0 + i Inf)) = pi/2", __imag__ result, M_PI_2); @@ -2390,10 +2787,10 @@ catanh_test (void) result = FUNC(catanh) (BUILD_COMPLEX (0, nan_value)); check ("real(catanh(0 + i NaN)) = 0", __real__ result, 0); - check_isnan ("imag(catanh(+Inf + i NaN)) = NaN", __imag__ result); + check_isnan ("imag(catanh(0 + i NaN)) = NaN", __imag__ result); result = FUNC(catanh) (BUILD_COMPLEX (minus_zero, nan_value)); check ("real(catanh(-0 + i NaN)) = -0", __real__ result, minus_zero); - check_isnan ("imag(catanh(-Inf + i NaN)) = NaN", __imag__ result); + check_isnan ("imag(catanh(-0 + i NaN)) = NaN", __imag__ result); result = FUNC(catanh) (BUILD_COMPLEX (plus_infty, nan_value)); check ("real(catanh(+Inf + i NaN)) = 0", __real__ result, 0); @@ -2404,8 +2801,8 @@ catanh_test (void) result = FUNC(catanh) (BUILD_COMPLEX (nan_value, 0)); check_isnan ("real(catanh(NaN + i0)) = NaN", __real__ result); - check_isnan ("imag(catanh(NaN + i0)) = NaN", __imag__ resul); - result = FUNC(catanh) (BUILD_COMPLEX (minus_zero, nan_value)); + check_isnan ("imag(catanh(NaN + i0)) = NaN", __imag__ result); + result = FUNC(catanh) (BUILD_COMPLEX (nan_value, minus_zero)); check_isnan ("real(catanh(NaN - i0)) = NaN", __real__ result); check_isnan ("imag(catanh(NaN - i0)) = NaN", __imag__ result); @@ -2426,7 +2823,7 @@ catanh_test (void) result = FUNC(catanh) (BUILD_COMPLEX (nan_value, 0.75)); check_isnan ("real(catanh(NaN + i0.75)) = NaN", __real__ result); check_isnan ("imag(catanh(NaN + i0.75)) = NaN", __imag__ result); - result = FUNC(catanh) (BUILD_COMPLEX (-10.5, nan_value)); + result = FUNC(catanh) (BUILD_COMPLEX (nan_value, -0.75)); check_isnan ("real(catanh(NaN - i0.75)) = NaN", __real__ result); check_isnan ("imag(catanh(NaN - i0.75)) = NaN", __imag__ result); @@ -2449,7 +2846,7 @@ ctanh_test (void) check ("imag(ctanh(0 - i0)) = -0", __imag__ result, minus_zero); result = FUNC(ctanh) (BUILD_COMPLEX (minus_zero, 0)); check ("real(ctanh(-0 + i0)) = -0", __real__ result, minus_zero); - check ("imag(ctanh(-0 + i0)) = -0", __imag__ result, 0); + check ("imag(ctanh(-0 + i0)) = 0", __imag__ result, 0); result = FUNC(ctanh) (BUILD_COMPLEX (minus_zero, minus_zero)); check ("real(ctanh(-0 - i0)) = -0", __real__ result, minus_zero); check ("imag(ctanh(-0 - i0)) = -0", __imag__ result, minus_zero); @@ -2472,7 +2869,7 @@ ctanh_test (void) result = FUNC(ctanh) (BUILD_COMPLEX (minus_infty, 1)); check ("real(ctanh(-Inf + i1)) = -1", __real__ result, -1); check ("imag(ctanh(-Inf + i1)) = 0", __imag__ result, 0); - result = FUNC(ctanh) (BUILD_COMPLEX (pminus_infty, minus_zero)); + result = FUNC(ctanh) (BUILD_COMPLEX (minus_infty, minus_zero)); check ("real(ctanh(-Inf - i0)) = -1", __real__ result, -1); check ("imag(ctanh(-Inf - i0)) = -0", __imag__ result, minus_zero); result = FUNC(ctanh) (BUILD_COMPLEX (minus_infty, -1)); @@ -2514,9 +2911,9 @@ ctanh_test (void) result = FUNC(ctanh) (BUILD_COMPLEX (nan_value, 0)); check_isnan ("real(ctanh(NaN + i0)) = NaN", __real__ result); check ("imag(ctanh(NaN + i0)) = 0", __imag__ result, 0); - result = FUNC(ctanh) (BUILD_COMPLEX (nan_value, minus_infty)); + result = FUNC(ctanh) (BUILD_COMPLEX (nan_value, minus_zero)); check_isnan ("real(ctanh(NaN - i0)) = NaN", __real__ result); - check ("imag(ctanh(NaN - i0)) = -0", __imag__ result, minus_infty); + check ("imag(ctanh(NaN - i0)) = -0", __imag__ result, minus_zero); result = FUNC(ctanh) (BUILD_COMPLEX (nan_value, 0.5)); check_isnan ("real(ctanh(NaN + i0.5)) = NaN", __real__ result); @@ -2542,7 +2939,6 @@ ctanh_test (void) check_isnan ("real(ctanh(NaN + i NaN)) = NaN", __real__ result); check_isnan ("imag(ctanh(NaN + i NaN)) = NaN", __imag__ result); } -#endif static void @@ -2639,7 +3035,7 @@ clog_test (void) result = FUNC(clog) (BUILD_COMPLEX (nan_value, plus_infty)); check_isinfp ("real(clog(NaN + i Inf)) = +Inf", __real__ result); check_isnan ("imag(clog(NaN + i Inf)) = NaN", __imag__ result); - result = FUNC(clog) (BUILD_COMPLEX (minus_infty, nan_value)); + result = FUNC(clog) (BUILD_COMPLEX (nan_value, minus_infty)); check_isinfp ("real(clog(NaN - i Inf)) = +Inf", __real__ result); check_isnan ("imag(clog(NaN - i Inf)) = NaN", __imag__ result); @@ -2675,7 +3071,6 @@ clog_test (void) } -#if 0 static void csqrt_test (void) { @@ -2709,16 +3104,16 @@ csqrt_test (void) result = FUNC(csqrt) (BUILD_COMPLEX (plus_infty, 0)); check_isinfp ("real(csqrt(+Inf + i0)) = +Inf", __real__ result); - check ("imag(csqrt(-Inf + i0)) = 0", __imag__ result, 0); + check ("imag(csqrt(+Inf + i0)) = 0", __imag__ result, 0); result = FUNC(csqrt) (BUILD_COMPLEX (plus_infty, 6)); check_isinfp ("real(csqrt(+Inf + i6)) = +Inf", __real__ result); - check ("imag(csqrt(-Inf + i6)) = 0", __imag__ result, 0); + check ("imag(csqrt(+Inf + i6)) = 0", __imag__ result, 0); result = FUNC(csqrt) (BUILD_COMPLEX (plus_infty, minus_zero)); check_isinfp ("real(csqrt(+Inf - i0)) = +Inf", __real__ result); - check ("imag(csqrt(-Inf - i0)) = -0", __imag__ result, minus_zero); + check ("imag(csqrt(+Inf - i0)) = -0", __imag__ result, minus_zero); result = FUNC(csqrt) (BUILD_COMPLEX (plus_infty, -6)); check_isinfp ("real(csqrt(+Inf - i6)) = +Inf", __real__ result); - check ("imag(csqrt(-Inf - i6)) = -0", __imag__ result, minus_zero); + check ("imag(csqrt(+Inf - i6)) = -0", __imag__ result, minus_zero); result = FUNC(csqrt) (BUILD_COMPLEX (0, plus_infty)); check_isinfp ("real(csqrt(0 + i Inf)) = +Inf", __real__ result); @@ -2796,7 +3191,23 @@ csqrt_test (void) check_isnan ("real(csqrt(NaN + i NaN)) = NaN", __real__ result); check_isnan ("imag(csqrt(NaN + i NaN)) = NaN", __imag__ result); } -#endif + + +static void +cpow_test (void) +{ + __complex__ MATHTYPE result; +} + + +static void +rint_test (void) +{ + check ("rint(0) = 0", FUNC(rint) (0.0), 0.0); + check ("rint(-0) = -0", FUNC(rint) (minus_zero), minus_zero); + check_isinfp ("rint(+Inf) = +Inf", FUNC(rint) (plus_infty)); + check_isinfn ("rint(-Inf) = -Inf", FUNC(rint) (minus_infty)); +} static void @@ -2806,16 +3217,17 @@ rinttol_test (void) the rounding method and test the critical cases. So far, only unproblematic numbers are tested. */ - check_long ("rinttol(0) = 0", 0.0, 0); - check_long ("rinttol(-0) = 0", minus_zero, 0); - check_long ("rinttol(0.2) = 0", 0.2, 0); - check_long ("rinttol(-0.2) = 0", -0.2, 0); + check_long ("rinttol(0) = 0", rinttol (0.0), 0); + check_long ("rinttol(-0) = 0", rinttol (minus_zero), 0); + check_long ("rinttol(0.2) = 0", rinttol (0.2), 0); + check_long ("rinttol(-0.2) = 0", rinttol (-0.2), 0); - check_long ("rinttol(1.4) = 1", 1.4, 1); - check_long ("rinttol(-1.4) = -1", -1.4, -1); + check_long ("rinttol(1.4) = 1", rinttol (1.4), 1); + check_long ("rinttol(-1.4) = -1", rinttol (-1.4), -1); - check_long ("rinttol(8388600.3) = 8388600", 8388600.3, 8388600); - check_long ("rinttol(-8388600.3) = -8388600", -8388600.3, -8388600); + check_long ("rinttol(8388600.3) = 8388600", rinttol (8388600.3), 8388600); + check_long ("rinttol(-8388600.3) = -8388600", rinttol (-8388600.3), + -8388600); } @@ -2826,16 +3238,79 @@ rinttoll_test (void) the rounding method and test the critical cases. So far, only unproblematic numbers are tested. */ - check_longlong ("rinttoll(0) = 0", 0.0, 0); - check_longlong ("rinttoll(-0) = 0", minus_zero, 0); - check_longlong ("rinttoll(0.2) = 0", 0.2, 0); - check_longlong ("rinttoll(-0.2) = 0", -0.2, 0); + check_longlong ("rinttoll(0) = 0", rinttoll (0.0), 0); + check_longlong ("rinttoll(-0) = 0", rinttoll (minus_zero), 0); + check_longlong ("rinttoll(0.2) = 0", rinttoll (0.2), 0); + check_longlong ("rinttoll(-0.2) = 0", rinttoll (-0.2), 0); - check_longlong ("rinttoll(1.4) = 1", 1.4, 1); - check_longlong ("rinttoll(-1.4) = -1", -1.4, -1); + check_longlong ("rinttoll(1.4) = 1", rinttoll (1.4), 1); + check_longlong ("rinttoll(-1.4) = -1", rinttoll (-1.4), -1); - check_longlong ("rinttoll(8388600.3) = 8388600", 8388600.3, 8388600); - check_longlong ("rinttoll(-8388600.3) = -8388600", -8388600.3, -8388600); + check_longlong ("rinttoll(8388600.3) = 8388600", rinttoll (8388600.3), + 8388600); + check_longlong ("rinttoll(-8388600.3) = -8388600", rinttoll (-8388600.3), + -8388600); +} + + +static void +round_test (void) +{ + check ("round(0) = 0", FUNC(round) (0), 0); + check ("round(-0) = -0", FUNC(round) (minus_zero), minus_zero); + check ("round(0.2) = 0", FUNC(round) (0.2), 0.0); + check ("round(-0.2) = -0", FUNC(round) (-0.2), minus_zero); + check ("round(0.5) = 1", FUNC(round) (0.5), 1.0); + check ("round(-0.5) = -1", FUNC(round) (-0.5), -1.0); + check ("round(0.8) = 1", FUNC(round) (0.8), 1.0); + check ("round(-0.8) = -1", FUNC(round) (-0.8), -1.0); + check ("round(1.5) = 2", FUNC(round) (1.5), 2.0); + check ("round(-1.5) = -2", FUNC(round) (-1.5), -2.0); + check ("round(2097152.5) = 2097153", FUNC(round) (2097152.5), 2097153); + check ("round(-2097152.5) = -2097153", FUNC(round) (-2097152.5), -2097153); +} + + +static void +roundtol_test (void) +{ + check_long ("roundtol(0) = 0", roundtol (0), 0); + check_long ("roundtol(-0) = 0", roundtol (minus_zero), 0); + check_long ("roundtol(0.2) = 0", roundtol (0.2), 0.0); + check_long ("roundtol(-0.2) = 0", roundtol (-0.2), 0); + check_long ("roundtol(0.5) = 1", roundtol (0.5), 1); + check_long ("roundtol(-0.5) = -1", roundtol (-0.5), -1); + check_long ("roundtol(0.8) = 1", roundtol (0.8), 1); + check_long ("roundtol(-0.8) = -1", roundtol (-0.8), -1); + check_long ("roundtol(1.5) = 2", roundtol (1.5), 2); + check_long ("roundtol(-1.5) = -2", roundtol (-1.5), -2); + check_long ("roundtol(2097152.5) = 2097153", roundtol (2097152.5), 2097153); + check_long ("roundtol(-2097152.5) = -2097153", roundtol (-2097152.5), + -2097153); +} + + +static void +roundtoll_test (void) +{ + check_longlong ("roundtoll(0) = 0", roundtoll (0), 0); + check_longlong ("roundtoll(-0) = 0", roundtoll (minus_zero), 0); + check_longlong ("roundtoll(0.2) = 0", roundtoll (0.2), 0.0); + check_longlong ("roundtoll(-0.2) = 0", roundtoll (-0.2), 0); + check_longlong ("roundtoll(0.5) = 1", roundtoll (0.5), 1); + check_longlong ("roundtoll(-0.5) = -1", roundtoll (-0.5), -1); + check_longlong ("roundtoll(0.8) = 1", roundtoll (0.8), 1); + check_longlong ("roundtoll(-0.8) = -1", roundtoll (-0.8), -1); + check_longlong ("roundtoll(1.5) = 2", roundtoll (1.5), 2); + check_longlong ("roundtoll(-1.5) = -2", roundtoll (-1.5), -2); + check_longlong ("roundtoll(2097152.5) = 2097153", + roundtoll (2097152.5), 2097153); + check_longlong ("roundtoll(-2097152.5) = -2097153", + roundtoll (-2097152.5), -2097153); + check_longlong ("roundtoll(34359738368.5) = 34359738369", + roundtoll (34359738368.5), 34359738369ll); + check_longlong ("roundtoll(-34359738368.5) = -34359738369", + roundtoll (-34359738368.5), -34359738369ll); } @@ -3168,11 +3643,25 @@ main (int argc, char *argv[]) #endif cexp_test (); csinh_test (); + ccos_test (); ccosh_test (); clog_test (); - + cacos_test (); + cacosh_test (); + casin_test (); + casinh_test (); + catan_test (); + catanh_test (); + ctanh_test (); + csqrt_test (); + cpow_test (); + + rint_test (); rinttol_test (); rinttoll_test (); + round_test (); + roundtol_test (); + roundtoll_test (); identities (); inverse_functions (); |