GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#18)
by t
04:52 queued 01:14
created

CMAT::csc()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
/**
3
 * Trait MathAndTrigonometry-C
4
 *
5
 * @link https://www.icy2003.com/
6
 * @author icy2003 <[email protected]>
7
 * @copyright Copyright (c) 2017, icy2003
8
 */
9
namespace icy2003\php\icomponents\excel\mathAndTrigonometry;
10
11
/**
12
 * MathAndTrigonometry-C
13
 */
14
trait CMAT
15
{
16
17
    /**
18
     * 返回将参数 number 向上舍入(沿绝对值增大的方向)为最接近的指定基数的倍数
19
     *
20
     * @param double $number  必需。 要舍入的值
21
     * @param double $significance 必需。 要舍入到的倍数
22
     *
23
     * @return double
24
     */
25 1
    public static function ceiling($number, $significance = 1)
26
    {
27 1
        return is_numeric($number) ? (ceil($number / $significance) * $significance) : false;
0 ignored issues
show
introduced by
The condition is_numeric($number) is always true.
Loading history...
28
    }
29
30
    /**
31
     * 返回给定数目的项目的组合数
32
     *
33
     * - C(m,n) = n! / (m! * (n - m)!),其中 0 ≤ m ≤ n
34
     *
35
     * @param integer $n 必需。 项目的数量
36
     * @param integer $m 必需。 每一组合中项目的数量
37
     *
38
     * @return integer
39
     */
40 2
    public static function combin($n, $m)
41
    {
42 2
        return (self::fact($n) / (self::fact($m) * self::fact($n - $m)));
43
    }
44
45
    /**
46
     * 返回给定数目的项的组合数(包含重复)
47
     *
48
     * @param integer $n 必需。 必须大于或等于 0 并大于或等于 m 非整数值将被截尾取整
49
     * @param integer $m 必需。 必须大于或等于 0。 非整数值将被截尾取整
50
     *
51
     * @return integer
52
     */
53 1
    public static function combina($n, $m)
54
    {
55 1
        return self::combin($n + $m - 1, $n - 1);
56
    }
57
58
    /**
59
     * 返回已知角度的余弦值
60
     *
61
     * @param double $number 必需。 想要求余弦的角度,以弧度表示
62
     *
63
     * @return double
64
     */
65 1
    public static function cos($number)
66
    {
67 1
        return cos($number);
68
    }
69
70
    /**
71
     * 返回数字的双曲余弦值
72
     *
73
     * - y = cosh(x) = (e^x + e^(-x)) / 2
74
     *
75
     * @param double $number 必需。 想要求双曲余弦的任意实数
76
     *
77
     * @return double
78
     */
79
    public static function cosh($number)
80
    {
81
        return cosh($number);
82
    }
83
84
    /**
85
     * 返回以弧度表示的角度的余切值
86
     *
87
     * @param double $number 必需。 要获得其余切值的角度,以弧度表示
88
     *
89
     * @return double
90
     */
91
    public static function cot($number)
92
    {
93
        return -tan(pi() / 2 + $number);
94
    }
95
96
    /**
97
     * 返回一个双曲角度的双曲余切值
98
     *
99
     * - y = coth(x) = 1 / tanh(x) = (e^x + e^(-x)) / (e^x - e^(-x))
100
     *
101
     * @param double $number 必需
102
     *
103
     * @return double
104
     */
105
    public static function coth($number)
106
    {
107
        return 1 / tanh($number);
108
    }
109
110
    /**
111
     * 返回角度的余割值,以弧度表示
112
     *
113
     * @param double $number 必需
114
     *
115
     * @return double
116
     */
117
    public static function csc($number)
118
    {
119
        return 1 / sin($number);
120
    }
121
122
    /**
123
     * 返回角度的双曲余割值,以弧度表示
124
     *
125
     * - y = csch(x) = 1 / sinh(x) = 2 / (e^x - e^(-x))
126
     *
127
     * @param double $number 必需
128
     *
129
     * @return double
130
     */
131
    public static function csch($number)
132
    {
133
        return 1 / sinh($number);
134
    }
135
}
136