Annotation of embedaddon/php/ext/standard/tests/math/hexdec_basiclong_64bit.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test hexdec function : 64bit long tests
3: --SKIPIF--
4: <?php
5: if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
6: ?>
7: --FILE--
8: <?php
9:
10: define("MAX_64Bit", 9223372036854775807);
11: define("MAX_32Bit", 2147483647);
12: define("MIN_64Bit", -9223372036854775807 - 1);
13: define("MIN_32Bit", -2147483647 - 1);
14:
15: $hexLongStrs = array(
16: '7'.str_repeat('f',15),
17: str_repeat('f',16),
18: '7'.str_repeat('f',7),
19: str_repeat('f',8),
20: '7'.str_repeat('f',16),
21: str_repeat('f',18),
22: '7'.str_repeat('f',8),
23: str_repeat('f',9)
24: );
25:
26:
27: foreach ($hexLongStrs as $strVal) {
28: echo "--- testing: $strVal ---\n";
29: var_dump(hexdec($strVal));
30: }
31:
32: ?>
33: ===DONE===
34: --EXPECT--
35: --- testing: 7fffffffffffffff ---
36: int(9223372036854775807)
37: --- testing: ffffffffffffffff ---
38: float(1.844674407371E+19)
39: --- testing: 7fffffff ---
40: int(2147483647)
41: --- testing: ffffffff ---
42: int(4294967295)
43: --- testing: 7ffffffffffffffff ---
44: float(1.4757395258968E+20)
45: --- testing: ffffffffffffffffff ---
46: float(4.7223664828696E+21)
47: --- testing: 7ffffffff ---
48: int(34359738367)
49: --- testing: fffffffff ---
50: int(68719476735)
51: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>