Annotation of embedaddon/php/ext/standard/tests/math/ceil_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test ceil() - basic function test for ceil()
! 3: --INI--
! 4: precision=14
! 5: --SKIPIF--
! 6: if (strtolower(PHP_OS) == 'darwin') {
! 7: die('SKIP OSX does weird things with -0 so this test doesn't work there');
! 8: }
! 9: --FILE--
! 10: <?php
! 11: /* Prototype : float ceil ( float $value )
! 12: * Description: Round fractions up.
! 13: * Source code: ext/standard/math.c
! 14: */
! 15:
! 16: echo "*** Testing ceil() : basic functionality ***\n";
! 17: $values = array(0,
! 18: -0,
! 19: 0.5,
! 20: -0.5,
! 21: 1,
! 22: -1,
! 23: 1.5,
! 24: -1.5,
! 25: 2.6,
! 26: -2.6,
! 27: 037,
! 28: 0x5F,
! 29: "10.5",
! 30: "-10.5",
! 31: "3.95E3",
! 32: "-3.95E3",
! 33: "039",
! 34: "0x5F",
! 35: true,
! 36: false,
! 37: null,
! 38: );
! 39:
! 40: for ($i = 0; $i < count($values); $i++) {
! 41: $res = ceil($values[$i]);
! 42: var_dump($res);
! 43: }
! 44:
! 45: ?>
! 46: ===Done===
! 47: --EXPECTF--
! 48: *** Testing ceil() : basic functionality ***
! 49: float(0)
! 50: float(0)
! 51: float(1)
! 52: float(-0)
! 53: float(1)
! 54: float(-1)
! 55: float(2)
! 56: float(-1)
! 57: float(3)
! 58: float(-2)
! 59: float(31)
! 60: float(95)
! 61: float(11)
! 62: float(-10)
! 63: float(3950)
! 64: float(-3950)
! 65: float(39)
! 66: float(95)
! 67: float(1)
! 68: float(0)
! 69: float(0)
! 70: ===Done===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>