diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-09-19 01:46:58 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-09-19 01:46:58 +0000 |
commit | e0ace5bfef384d5281cf4c03bcf59253f10d6273 (patch) | |
tree | 41904aed2509bdf528b8ae071dc83658a6b71db3 /tests/tisqrt.c | |
parent | 502dd1e28b0895e3536cfc951ef0262bb8af14ef (diff) | |
download | mpfr-e0ace5bfef384d5281cf4c03bcf59253f10d6273.tar.gz |
tisqrt.c: improved tests. When doing
touch tests.c tisqrt.c
make tisqrt CFLAGS="-g -O2 -ffloat-store -DMPFR_FPU_PREC=_FPU_SINGLE"
./tisqrt
with gcc 4.2.1 on a Linux/x86 machine, on gets:
Error in __gmpfr_cuberoot (4251527999): got 1620 instead of 1619
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4861 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tisqrt.c')
-rw-r--r-- | tests/tisqrt.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/tisqrt.c b/tests/tisqrt.c index e2c106ed8..cf09015e9 100644 --- a/tests/tisqrt.c +++ b/tests/tisqrt.c @@ -56,6 +56,10 @@ tst_icbrt (unsigned long n, unsigned long r) int main (void) { + unsigned long c, i; + + tests_start_mpfr (); + tst_isqrt (0, 0); tst_isqrt (1, 1); tst_isqrt (2, 1); @@ -92,10 +96,15 @@ main (void) tst_icbrt (26, 2); tst_icbrt (27, 3); tst_icbrt (28, 3); - tst_icbrt (4291015624UL, 1624); - tst_icbrt (4291015625UL, 1625); - tst_icbrt (4291015626UL, 1625); + for (i = 1620; i <= 1625; i++) + { + c = i * i * i; + tst_icbrt (c - 1, i - 1); + tst_icbrt (c, i); + tst_icbrt (c + 1, i); + } tst_icbrt (4294967295UL, 1625); + tests_end_mpfr (); return 0; } |