Download src/php/php-src/ext/bcmath/tests/number/methods/ceil.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 737 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/bcmath/tests/number/methods/ceil.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/bcmath/tests/number/methods/ceil.phpt
-
curl -L -o ceil.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/bcmath/tests/number/methods/ceil.phpt
737 Bytes
| --TEST-- | |
| BcMath\Number ceil() | |
| --EXTENSIONS-- | |
| bcmath | |
| --FILE-- | |
| $nums = [ | |
| '0', | |
| '0.00', | |
| '-0', | |
| '-0.00', | |
| '0.01', | |
| '0.000000000000000000000000000000000000000001', | |
| '-0.01', | |
| '-0.000000000000000000000000000000000000000001', | |
| '1', | |
| '1.0000', | |
| '1.0001', | |
| '100000.000000000000000000000000000000000000000001', | |
| '-1', | |
| '-1.0000', | |
| '-1.0001', | |
| '-100000.000000000000000000000000000000000000000001', | |
| ]; | |
| foreach ($nums as $num) { | |
| $func_ret = bcceil($num); | |
| $method_ret = (new BcMath\Number($num))->ceil(); | |
| if ($method_ret->compare($func_ret, 0) !== 0) { | |
| echo "Result is incorrect.\n"; | |
| var_dump($num, $func_ret, $method_ret); | |
| } | |
| } | |
| echo 'done!'; | |
| --EXPECT-- | |
| done! | |