1--TEST--
2Test cos function : 64bit long tests
3--SKIPIF--
4<?php
5if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
6?>
7--INI--
8serialize_precision=14
9--FILE--
10<?php
11
12define("MAX_64Bit", 9223372036854775807);
13define("MAX_32Bit", 2147483647);
14define("MIN_64Bit", -9223372036854775807 - 1);
15define("MIN_32Bit", -2147483647 - 1);
16
17$longVals = array(
18    MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
19    MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
20    MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
21);
22
23
24foreach ($longVals as $longVal) {
25   echo "--- testing: $longVal ---\n";
26   var_dump(cos($longVal));
27}
28
29?>
30--EXPECT--
31--- testing: 9223372036854775807 ---
32float(0.0118000765128)
33--- testing: -9223372036854775808 ---
34float(0.0118000765128)
35--- testing: 2147483647 ---
36float(-0.68883669187794)
37--- testing: -2147483648 ---
38float(0.2378161945728)
39--- testing: 9223372034707292160 ---
40float(-0.96843630065544)
41--- testing: -9223372034707292160 ---
42float(-0.96843630065544)
43--- testing: 2147483648 ---
44float(0.2378161945728)
45--- testing: -2147483649 ---
46float(0.94582196847889)
47--- testing: 4294967294 ---
48float(-0.051008023845301)
49--- testing: 4294967295 ---
50float(-0.8679353473572)
51--- testing: 4294967293 ---
52float(0.81281584155442)
53--- testing: 9223372036854775806 ---
54float(0.0118000765128)
55--- testing: 9.2233720368548E+18 ---
56float(0.0118000765128)
57--- testing: -9223372036854775807 ---
58float(0.0118000765128)
59--- testing: -9.2233720368548E+18 ---
60float(0.0118000765128)
61