Annotation of embedaddon/php/ext/standard/tests/math/rad2deg_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test return type and value for expected input rad2deg()
! 3: --INI--
! 4: precision = 14
! 5: --FILE--
! 6: <?php
! 7: /*
! 8: * proto float rad2deg(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: $arg_0 = 0.0;
! 16: $arg_1 = 1.570796327;
! 17: $arg_2 = 3.141592654;
! 18: $arg_3 = 6.283185307;
! 19:
! 20: echo "rad2deg $arg_0= ";
! 21: $r0 = rad2deg($arg_0);
! 22: var_dump($r0);
! 23: if (allowed_rounding_error($r0 ,0 )) {
! 24: echo "Pass\n";
! 25: }
! 26: else {
! 27: echo "Fail\n";
! 28: }
! 29: echo "rad2deg $arg_1 = ";
! 30: $r1 = rad2deg($arg_1);
! 31: var_dump($r1);
! 32: if (allowed_rounding_error($r1 ,90.000000011752)) {
! 33: echo "Pass\n";
! 34: }
! 35: else {
! 36: echo "Fail\n";
! 37: }
! 38: echo "rad2deg $arg_2 = ";
! 39: $r2 = rad2deg($arg_2);
! 40: var_dump($r2);
! 41: if (allowed_rounding_error($r2 ,180.0000000235 )) {
! 42: echo "Pass\n";
! 43: }
! 44: else {
! 45: echo "Fail\n";
! 46: }
! 47: echo "rad2deg $arg_3 = ";
! 48: $r3 = rad2deg($arg_3);
! 49: var_dump($r3);
! 50: if (allowed_rounding_error($r3 ,359.99999998971 )) {
! 51: echo "Pass\n";
! 52: }
! 53: else {
! 54: echo "Fail\n";
! 55: }
! 56: ?>
! 57: --EXPECTF--
! 58: rad2deg 0= float(%f)
! 59: Pass
! 60: rad2deg 1.570796327 = float(%f)
! 61: Pass
! 62: rad2deg 3.141592654 = float(%f)
! 63: Pass
! 64: rad2deg 6.283185307 = float(%f)
! 65: Pass
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>