Annotation of embedaddon/php/ext/standard/tests/math/expm1_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test expm1() - basic function test for expm1()
! 3: --INI--
! 4: precision=14
! 5: --FILE--
! 6: <?php
! 7: /* Prototype : float expm1 ( float $arg )
! 8: * Description: Returns exp(number) - 1, computed in a way that is accurate even
! 9: * when the value of number is close to zero.
! 10: * Source code: ext/standard/math.c
! 11: */
! 12:
! 13: echo "*** Testing expm1() : basic functionality ***\n";
! 14: $values = array(10,
! 15: 10.3,
! 16: 3.9505e3,
! 17: 037,
! 18: 0x5F,
! 19: "10",
! 20: "3950.5",
! 21: "3.9505e3",
! 22: "039",
! 23: "0x5F",
! 24: true,
! 25: false,
! 26: null,
! 27: );
! 28:
! 29: // loop through each element of $values to check the behaviour of expm1()
! 30: $iterator = 1;
! 31: foreach($values as $value) {
! 32: echo "\n-- Iteration $iterator --\n";
! 33: var_dump(expm1($value));
! 34: $iterator++;
! 35: };
! 36: ?>
! 37: ===Done===
! 38: --EXPECTF--
! 39: *** Testing expm1() : basic functionality ***
! 40:
! 41: -- Iteration 1 --
! 42: float(22025.465794807)
! 43:
! 44: -- Iteration 2 --
! 45: float(29731.618852891)
! 46:
! 47: -- Iteration 3 --
! 48: float(INF)
! 49:
! 50: -- Iteration 4 --
! 51: float(29048849665246)
! 52:
! 53: -- Iteration 5 --
! 54: float(1.811239082889E+41)
! 55:
! 56: -- Iteration 6 --
! 57: float(22025.465794807)
! 58:
! 59: -- Iteration 7 --
! 60: float(INF)
! 61:
! 62: -- Iteration 8 --
! 63: float(INF)
! 64:
! 65: -- Iteration 9 --
! 66: float(8.6593400423994E+16)
! 67:
! 68: -- Iteration 10 --
! 69: float(1.811239082889E+41)
! 70:
! 71: -- Iteration 11 --
! 72: float(1.718281828459)
! 73:
! 74: -- Iteration 12 --
! 75: float(0)
! 76:
! 77: -- Iteration 13 --
! 78: float(0)
! 79: ===Done===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>