summaryrefslogtreecommitdiff
path: root/ext/gmp/tests/014.phpt
blob: f8bf7384d11ab9cbdfdeb309dd0e73a1e85261e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
--TEST--
gmp_fact() basic tests
--FILE--
<?php

var_dump(gmp_strval(gmp_fact(0)));
var_dump(gmp_strval(gmp_fact("")));
var_dump(gmp_strval(gmp_fact("0")));
var_dump(gmp_strval(gmp_fact("-1")));
var_dump(gmp_strval(gmp_fact(-1)));
var_dump(gmp_strval(gmp_fact(1.1)));
var_dump(gmp_strval(gmp_fact(20)));
var_dump(gmp_strval(gmp_fact("50")));
var_dump(gmp_strval(gmp_fact("10")));
var_dump(gmp_strval(gmp_fact("0000")));

$n = gmp_init(12);
var_dump(gmp_strval(gmp_fact($n)));
$n = gmp_init(-10);
var_dump(gmp_strval(gmp_fact($n)));

var_dump(gmp_fact());
var_dump(gmp_fact(1,1));
var_dump(gmp_fact(array()));
var_dump(gmp_strval(gmp_fact(array())));

echo "Done\n";
?>
--EXPECTF--	
string(1) "1"
string(1) "1"
string(1) "1"

Warning: gmp_fact(): Number has to be greater than or equal to 0 in %s on line %d
string(1) "0"

Warning: gmp_fact(): Number has to be greater than or equal to 0 in %s on line %d
string(1) "0"
string(1) "1"
string(19) "2432902008176640000"
string(65) "30414093201713378043612608166064768844377641568960512000000000000"
string(7) "3628800"
string(1) "1"
string(11) "87178291200"

Warning: gmp_fact(): Number has to be greater than or equal to 0 in %s on line %d
string(1) "0"

Warning: Wrong parameter count for gmp_fact() in %s on line %d
NULL

Warning: Wrong parameter count for gmp_fact() in %s on line %d
NULL
resource(%d) of type (GMP integer)
string(1) "1"
Done
--UEXPECTF--
unicode(1) "1"
unicode(1) "1"
unicode(1) "1"

Warning: gmp_fact(): Number has to be greater than or equal to 0 in %s on line %d
unicode(1) "0"

Warning: gmp_fact(): Number has to be greater than or equal to 0 in %s on line %d
unicode(1) "0"
unicode(1) "1"
unicode(19) "2432902008176640000"
unicode(65) "30414093201713378043612608166064768844377641568960512000000000000"
unicode(7) "3628800"
unicode(1) "1"
unicode(11) "87178291200"

Warning: gmp_fact(): Number has to be greater than or equal to 0 in %s on line %d
unicode(1) "0"

Warning: Wrong parameter count for gmp_fact() in %s on line %d
NULL

Warning: Wrong parameter count for gmp_fact() in %s on line %d
NULL
resource(%d) of type (GMP integer)
unicode(1) "1"
Done