Annotation of embedaddon/php/ext/standard/tests/math/cosh_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test return type and value for expected input cosh()
! 3: --INI--
! 4: precision = 14
! 5: --FILE--
! 6: <?php
! 7: /*
! 8: * proto float cosh(float number)
! 9: * Function is implemented in ext/standard/math.c
! 10: */
! 11:
! 12: $file_path = dirname(__FILE__);
! 13: require($file_path."/allowed_rounding_error.inc");
! 14:
! 15: echo "cosh .5 = ";
! 16: var_dump(cosh(0.5));
! 17:
! 18: if (allowed_rounding_error(cosh(0.5),1.1276259652064)){
! 19: echo "Pass\n";
! 20: }
! 21: else {
! 22: echo "Fail\n";
! 23: }
! 24:
! 25: echo "cosh -0.5 = ";
! 26: var_dump(cosh(-0.5));
! 27: if (allowed_rounding_error(cosh(-0.5),1.1276259652064)){
! 28: echo "Pass\n";
! 29: }
! 30: else {
! 31: echo "Fail\n";
! 32: }
! 33:
! 34: echo "cosh 3 = ";
! 35: var_dump(cosh(3.0));
! 36: if (allowed_rounding_error(cosh(3.0), 10.067661995778)){
! 37: echo "Pass\n";
! 38: }
! 39: else {
! 40: echo "Fail\n";
! 41: }
! 42:
! 43: echo "cosh -3 = ";
! 44: var_dump(cosh(-3.0));
! 45: if (allowed_rounding_error(cosh(-3.0), 10.067661995778)){
! 46: echo "Pass\n";
! 47: }
! 48: else {
! 49: echo "Fail\n";
! 50: }
! 51:
! 52: ?>
! 53: --EXPECTF--
! 54: cosh .5 = float(%f)
! 55: Pass
! 56: cosh -0.5 = float(%f)
! 57: Pass
! 58: cosh 3 = float(%f)
! 59: Pass
! 60: cosh -3 = float(%f)
! 61: Pass
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>