Annotation of embedaddon/php/ext/gmp/tests/016.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: gmp_powm() basic tests
                      3: --SKIPIF--
                      4: <?php if (!extension_loaded("gmp")) print "skip"; ?>
                      5: --FILE--
                      6: <?php
                      7: 
                      8: var_dump(gmp_strval(gmp_powm(0,1,10)));
                      9: var_dump(gmp_strval(gmp_powm(5,1,10)));
                     10: var_dump(gmp_strval(gmp_powm(-5,1,-10)));
                     11: var_dump(gmp_strval(gmp_powm(-5,1,10)));
                     12: var_dump(gmp_strval(gmp_powm(-5,11,10)));
                     13: var_dump(gmp_strval(gmp_powm("77",3,1000)));
                     14: 
                     15: $n = gmp_init(11);
                     16: var_dump(gmp_strval(gmp_powm($n,3,1000)));
                     17: $e = gmp_init(7);
                     18: var_dump(gmp_strval(gmp_powm($n,$e,1000)));
                     19: $m = gmp_init(900);
                     20: var_dump(gmp_strval(gmp_powm($n,$e,$m)));
                     21: 
                     22: var_dump(gmp_powm(array(),$e,$m));
                     23: var_dump(gmp_powm($n,array(),$m));
                     24: var_dump(gmp_powm($n,$e,array()));
                     25: var_dump(gmp_powm(array(),array(),array()));
                     26: var_dump(gmp_powm(array(),array()));
                     27: var_dump(gmp_powm(array()));
                     28: var_dump(gmp_powm());
                     29: 
                     30: $n = gmp_init("-5");
                     31: var_dump(gmp_powm(10, $n, 10));
                     32: 
                     33: $n = gmp_init("0");
                     34: var_dump(gmp_powm(10, $n, 10));
                     35: 
                     36: echo "Done\n";
                     37: ?>
                     38: --EXPECTF--    
                     39: string(1) "0"
                     40: string(1) "5"
                     41: string(1) "5"
                     42: string(1) "5"
                     43: string(1) "5"
                     44: string(3) "533"
                     45: string(3) "331"
                     46: string(3) "171"
                     47: string(3) "371"
                     48: 
                     49: Warning: gmp_powm(): Unable to convert variable to GMP - wrong type in %s on line %d
                     50: bool(false)
                     51: 
                     52: Warning: gmp_powm(): Unable to convert variable to GMP - wrong type in %s on line %d
                     53: bool(false)
                     54: 
                     55: Warning: gmp_powm(): Unable to convert variable to GMP - wrong type in %s on line %d
                     56: bool(false)
                     57: 
                     58: Warning: gmp_powm(): Unable to convert variable to GMP - wrong type in %s on line %d
                     59: bool(false)
                     60: 
                     61: Warning: gmp_powm() expects exactly 3 parameters, 2 given in %s on line %d
                     62: NULL
                     63: 
                     64: Warning: gmp_powm() expects exactly 3 parameters, 1 given in %s on line %d
                     65: NULL
                     66: 
                     67: Warning: gmp_powm() expects exactly 3 parameters, 0 given in %s on line %d
                     68: NULL
                     69: 
                     70: Warning: gmp_powm(): Second parameter cannot be less than 0 in %s on line %d
                     71: bool(false)
                     72: resource(%d) of type (GMP integer)
                     73: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>