summaryrefslogtreecommitdiff
path: root/Zend/tests/double_to_string_64bit.phpt
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:37:27 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:37:27 -0400
commit2d4e5b09576bb4f0ba716cc82cdf29ea04d9184b (patch)
tree41ccc042009cba53e4ce43e727fcba4c1cfbf7f3 /Zend/tests/double_to_string_64bit.phpt
parentd29a4fd2dd3b5d4cf6e80b602544d7b71d794e76 (diff)
downloadphp-upstream/5.2.2.tar.gz
Imported Upstream version 5.2.2upstream/5.2.2
Diffstat (limited to 'Zend/tests/double_to_string_64bit.phpt')
-rw-r--r--Zend/tests/double_to_string_64bit.phpt56
1 files changed, 56 insertions, 0 deletions
diff --git a/Zend/tests/double_to_string_64bit.phpt b/Zend/tests/double_to_string_64bit.phpt
new file mode 100644
index 000000000..c52c38c57
--- /dev/null
+++ b/Zend/tests/double_to_string_64bit.phpt
@@ -0,0 +1,56 @@
+--TEST--
+double to string conversion tests (64bit)
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
+--FILE--
+<?php
+
+$doubles = array(
+ 29000000000000000000000000000000000000,
+ 290000000000000000,
+ 290000000000000,
+ 29000000000000,
+ 29000000000000.123123,
+ 29000000000000.7123123,
+ 29000.7123123,
+ 239234242.7123123,
+ 0.12345678901234567890,
+ 10000000000000000000000000000000000000000000000,
+ 1000000000000000000000000000000000,
+ 100000000000000001,
+ 1000006000000000011,
+ 100000000000001,
+ 10000000000,
+ 999999999999999999,
+ 9999999999999999999,
+ 9999999999999999999999999999999999999,
+ (float)0
+ );
+
+foreach ($doubles as $d) {
+ var_dump((string)$d);
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(7) "2.9E+37"
+string(18) "290000000000000000"
+string(15) "290000000000000"
+string(14) "29000000000000"
+string(14) "29000000000000"
+string(14) "29000000000001"
+string(13) "29000.7123123"
+string(15) "239234242.71231"
+string(16) "0.12345678901235"
+string(7) "1.0E+46"
+string(7) "1.0E+33"
+string(18) "100000000000000001"
+string(19) "1000006000000000011"
+string(15) "100000000000001"
+string(11) "10000000000"
+string(18) "999999999999999999"
+string(7) "1.0E+19"
+string(7) "1.0E+37"
+string(1) "0"
+Done