Skip to content

Commit d8b1e71

Browse files
committed
Fix test "number_format_decimals" on 32bit
1 parent f9d7309 commit d8b1e71

File tree

1 file changed

+30
-26
lines changed

1 file changed

+30
-26
lines changed

ext/standard/tests/math/number_format_decimals.phpt

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
Test number_format() - test function with different decimal places
33
--FILE--
44
<?php
5+
6+
define("MAX_INT32", 2147483647);
7+
define("MIN_INT32", -2147483647 - 1);
8+
59
$values = array(
610
1.5151,
711
15.151,
@@ -21,8 +25,8 @@ $values = array(
2125
-999999,
2226
999999.0,
2327
-999999.0,
24-
PHP_INT_MAX,
25-
PHP_INT_MIN,
28+
MAX_INT32,
29+
MIN_INT32,
2630
);
2731

2832
$decimals = array(0, 1, 2, 3, 4, 5, -1, -2, -3, -4, -5);
@@ -255,27 +259,27 @@ testing float(-999999)
255259
... with decimal places of -3: string(10) "-1,000,000"
256260
... with decimal places of -4: string(10) "-1,000,000"
257261
... with decimal places of -5: string(10) "-1,000,000"
258-
testing int(9223372036854775807)
259-
... with decimal places of 0: string(25) "9,223,372,036,854,775,807"
260-
... with decimal places of 1: string(27) "9,223,372,036,854,775,807.0"
261-
... with decimal places of 2: string(28) "9,223,372,036,854,775,807.00"
262-
... with decimal places of 3: string(29) "9,223,372,036,854,775,807.000"
263-
... with decimal places of 4: string(30) "9,223,372,036,854,775,807.0000"
264-
... with decimal places of 5: string(31) "9,223,372,036,854,775,807.00000"
265-
... with decimal places of -1: string(25) "9,223,372,036,854,775,810"
266-
... with decimal places of -2: string(25) "9,223,372,036,854,775,800"
267-
... with decimal places of -3: string(25) "9,223,372,036,854,776,000"
268-
... with decimal places of -4: string(25) "9,223,372,036,854,780,000"
269-
... with decimal places of -5: string(25) "9,223,372,036,854,800,000"
270-
testing int(-9223372036854775808)
271-
... with decimal places of 0: string(26) "-9,223,372,036,854,775,808"
272-
... with decimal places of 1: string(28) "-9,223,372,036,854,775,808.0"
273-
... with decimal places of 2: string(29) "-9,223,372,036,854,775,808.00"
274-
... with decimal places of 3: string(30) "-9,223,372,036,854,775,808.000"
275-
... with decimal places of 4: string(31) "-9,223,372,036,854,775,808.0000"
276-
... with decimal places of 5: string(32) "-9,223,372,036,854,775,808.00000"
277-
... with decimal places of -1: string(26) "-9,223,372,036,854,775,810"
278-
... with decimal places of -2: string(26) "-9,223,372,036,854,775,800"
279-
... with decimal places of -3: string(26) "-9,223,372,036,854,776,000"
280-
... with decimal places of -4: string(26) "-9,223,372,036,854,780,000"
281-
... with decimal places of -5: string(26) "-9,223,372,036,854,800,000"
262+
testing int(2147483647)
263+
... with decimal places of 0: string(13) "2,147,483,647"
264+
... with decimal places of 1: string(15) "2,147,483,647.0"
265+
... with decimal places of 2: string(16) "2,147,483,647.00"
266+
... with decimal places of 3: string(17) "2,147,483,647.000"
267+
... with decimal places of 4: string(18) "2,147,483,647.0000"
268+
... with decimal places of 5: string(19) "2,147,483,647.00000"
269+
... with decimal places of -1: string(13) "2,147,483,650"
270+
... with decimal places of -2: string(13) "2,147,483,600"
271+
... with decimal places of -3: string(13) "2,147,484,000"
272+
... with decimal places of -4: string(13) "2,147,480,000"
273+
... with decimal places of -5: string(13) "2,147,500,000"
274+
testing int(-2147483648)
275+
... with decimal places of 0: string(14) "-2,147,483,648"
276+
... with decimal places of 1: string(16) "-2,147,483,648.0"
277+
... with decimal places of 2: string(17) "-2,147,483,648.00"
278+
... with decimal places of 3: string(18) "-2,147,483,648.000"
279+
... with decimal places of 4: string(19) "-2,147,483,648.0000"
280+
... with decimal places of 5: string(20) "-2,147,483,648.00000"
281+
... with decimal places of -1: string(14) "-2,147,483,650"
282+
... with decimal places of -2: string(14) "-2,147,483,600"
283+
... with decimal places of -3: string(14) "-2,147,484,000"
284+
... with decimal places of -4: string(14) "-2,147,480,000"
285+
... with decimal places of -5: string(14) "-2,147,500,000"

0 commit comments

Comments
 (0)