Total Complexity | 8 |
Total Lines | 80 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class Cosine |
||
9 | { |
||
10 | /** |
||
11 | * COS. |
||
12 | * |
||
13 | * Returns the result of builtin function cos after validating args. |
||
14 | * |
||
15 | * @param mixed $number Should be numeric |
||
16 | * |
||
17 | * @return float|string cosine |
||
18 | */ |
||
19 | 12 | public static function cos($number) |
|
20 | { |
||
21 | try { |
||
22 | 12 | $number = Helpers::validateNumericNullBool($number); |
|
23 | 1 | } catch (Exception $e) { |
|
24 | 1 | return $e->getMessage(); |
|
25 | } |
||
26 | |||
27 | 11 | return cos($number); |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * COSH. |
||
32 | * |
||
33 | * Returns the result of builtin function cosh after validating args. |
||
34 | * |
||
35 | * @param mixed $number Should be numeric |
||
36 | * |
||
37 | * @return float|string hyperbolic cosine |
||
38 | */ |
||
39 | 7 | public static function cosh($number) |
|
48 | } |
||
49 | |||
50 | /** |
||
51 | * ACOS. |
||
52 | * |
||
53 | * Returns the arccosine of a number. |
||
54 | * |
||
55 | * @param float $number Number |
||
56 | * |
||
57 | * @return float|string The arccosine of the number |
||
58 | */ |
||
59 | 11 | public static function acos($number) |
|
60 | { |
||
61 | try { |
||
62 | 11 | $number = Helpers::validateNumericNullBool($number); |
|
63 | 1 | } catch (Exception $e) { |
|
64 | 1 | return $e->getMessage(); |
|
65 | } |
||
66 | |||
67 | 10 | return Helpers::numberOrNan(acos($number)); |
|
68 | } |
||
69 | |||
70 | /** |
||
71 | * ACOSH. |
||
72 | * |
||
73 | * Returns the arc inverse hyperbolic cosine of a number. |
||
74 | * |
||
75 | * @param float $number Number |
||
76 | * |
||
77 | * @return float|string The inverse hyperbolic cosine of the number, or an error string |
||
78 | */ |
||
79 | 10 | public static function acosh($number) |
|
88 | } |
||
89 | } |
||
90 |