xref: /php-src/ext/standard/tests/math/tan_basic.phpt (revision b5c7a83d)
1--TEST--
2Test return type and value for expected input tan()
3--INI--
4precision = 14
5--FILE--
6<?php
7/*
8 * Function is implemented in ext/standard/math.c
9*/
10
11$file_path = __DIR__;
12require($file_path."/allowed_rounding_error.inc");
13
14$sixty = M_PI / 3.0;
15$thirty = M_PI / 6.0;
16
17echo "tan 60 = ";
18var_dump(tan($sixty));
19if (allowed_rounding_error(tan($sixty),1.7320508075689)) {
20    echo "Pass\n";
21}
22else {
23    echo "Fail\n";
24}
25
26echo "tan 30 = ";
27var_dump(tan($thirty));
28if (allowed_rounding_error(tan($thirty),0.57735026918963)) {
29    echo "Pass\n";
30}
31else {
32    echo "Fail\n";
33}
34
35?>
36--EXPECTF--
37tan 60 = float(%f)
38Pass
39tan 30 = float(%f)
40Pass
41