Annotation of embedaddon/php/Zend/tests/double_to_string_64bit.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: double to string conversion tests (64bit)
3: --SKIPIF--
4: <?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
5: --INI--
6: precision=14
7: --FILE--
8: <?php
9:
10: $doubles = array(
11: 29000000000000000000000000000000000000,
12: 290000000000000000,
13: 290000000000000,
14: 29000000000000,
15: 29000000000000.123123,
16: 29000000000000.7123123,
17: 29000.7123123,
18: 239234242.7123123,
19: 0.12345678901234567890,
20: 10000000000000000000000000000000000000000000000,
21: 1000000000000000000000000000000000,
22: 100000000000000001,
23: 1000006000000000011,
24: 100000000000001,
25: 10000000000,
26: 999999999999999999,
27: 9999999999999999999,
28: 9999999999999999999999999999999999999,
29: (float)0
30: );
31:
32: foreach ($doubles as $d) {
33: var_dump((string)$d);
34: }
35:
36: echo "Done\n";
37: ?>
38: --EXPECTF--
39: string(7) "2.9E+37"
40: string(18) "290000000000000000"
41: string(15) "290000000000000"
42: string(14) "29000000000000"
43: string(14) "29000000000000"
44: string(14) "29000000000001"
45: string(13) "29000.7123123"
46: string(15) "239234242.71231"
47: string(16) "0.12345678901235"
48: string(7) "1.0E+46"
49: string(7) "1.0E+33"
50: string(18) "100000000000000001"
51: string(19) "1000006000000000011"
52: string(15) "100000000000001"
53: string(11) "10000000000"
54: string(18) "999999999999999999"
55: string(7) "1.0E+19"
56: string(7) "1.0E+37"
57: string(1) "0"
58: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>