Annotation of embedaddon/php/ext/gmp/tests/024.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: gmp_jacobi() basic tests
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("gmp")) print "skip"; ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: for ($i = -1; $i < 10; $i++) {
! 9: var_dump(gmp_strval(gmp_jacobi(($i*$i)-1, 3)));
! 10: }
! 11:
! 12: var_dump(gmp_strval(gmp_jacobi(7, 23)));
! 13: var_dump(gmp_strval(gmp_jacobi("733535124", "1234123423434535623")));
! 14: var_dump(gmp_strval(gmp_jacobi(3, "1234123423434535623")));
! 15:
! 16: $n = "123123";
! 17: $n1 = "1231231";
! 18:
! 19: var_dump(gmp_strval(gmp_jacobi($n, $n1)));
! 20: var_dump(gmp_strval(gmp_jacobi($n, 3)));
! 21: var_dump(gmp_strval(gmp_jacobi(3, $n1)));
! 22:
! 23: var_dump(gmp_jacobi(3, array()));
! 24: var_dump(gmp_jacobi(array(), 3));
! 25: var_dump(gmp_jacobi(array(), array()));
! 26:
! 27: var_dump(gmp_jacobi(array(), array(), 1));
! 28: var_dump(gmp_jacobi(array()));
! 29: var_dump(gmp_jacobi());
! 30:
! 31: echo "Done\n";
! 32: ?>
! 33: --EXPECTF--
! 34: string(1) "0"
! 35: string(2) "-1"
! 36: string(1) "0"
! 37: string(1) "0"
! 38: string(2) "-1"
! 39: string(1) "0"
! 40: string(1) "0"
! 41: string(2) "-1"
! 42: string(1) "0"
! 43: string(1) "0"
! 44: string(2) "-1"
! 45: string(2) "-1"
! 46: string(1) "0"
! 47: string(1) "0"
! 48: string(2) "-1"
! 49: string(1) "0"
! 50: string(2) "-1"
! 51:
! 52: Warning: gmp_jacobi(): Unable to convert variable to GMP - wrong type in %s on line %d
! 53: bool(false)
! 54:
! 55: Warning: gmp_jacobi(): Unable to convert variable to GMP - wrong type in %s on line %d
! 56: bool(false)
! 57:
! 58: Warning: gmp_jacobi(): Unable to convert variable to GMP - wrong type in %s on line %d
! 59: bool(false)
! 60:
! 61: Warning: gmp_jacobi() expects exactly 2 parameters, 3 given in %s on line %d
! 62: NULL
! 63:
! 64: Warning: gmp_jacobi() expects exactly 2 parameters, 1 given in %s on line %d
! 65: NULL
! 66:
! 67: Warning: gmp_jacobi() expects exactly 2 parameters, 0 given in %s on line %d
! 68: NULL
! 69: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>