TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

39 lines
709 B

--TEST--
Test fprintf() function (variation - 5)
--FILE--
<?php
$int_numbers = array( 0, 1, -1, 2.7, -2.7, 23333333, -23333333, "1234" );
/* creating dumping file */
$data_file = __DIR__ . '/fprintf_variation_005.txt';
if (!($fp = fopen($data_file, 'wt')))
return;
/* %e type variations */
fprintf($fp, "\n*** Testing fprintf() for scientific type ***\n");
foreach( $int_numbers as $num ) {
fprintf( $fp, "\n");
fprintf( $fp, "%e", $num );
}
fclose($fp);
print_r(file_get_contents($data_file));
echo "\nDone";
unlink($data_file);
?>
--EXPECT--
*** Testing fprintf() for scientific type ***
0.000000e+0
1.000000e+0
-1.000000e+0
2.700000e+0
-2.700000e+0
2.333333e+7
-2.333333e+7
1.234000e+3
Done