@@ -17,35 +17,95 @@ def test_PI
1717 BigMath , :PI , 10
1818 end
1919
20+ def test_acos
21+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
22+ BigMath , :acos , BigDecimal ( '0.5' ) , 32
23+ end
24+
25+ def test_acosh
26+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
27+ BigMath , :acosh , BigDecimal ( '2' ) , 32
28+ end
29+
30+ def test_asin
31+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
32+ BigMath , :asin , BigDecimal ( '0.5' ) , 32
33+ end
34+
35+ def test_asinh
36+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
37+ BigMath , :asinh , BigDecimal ( '1' ) , 32
38+ end
39+
2040 def test_atan
2141 assert_send_type "(::BigDecimal x, ::Numeric prec) -> ::BigDecimal" ,
2242 BigMath , :atan , BigDecimal ( '1.23' ) , 10
2343 end
2444
45+ def test_atan2
46+ assert_send_type "(::BigDecimal, ::BigDecimal, ::Numeric) -> ::BigDecimal" ,
47+ BigMath , :atan2 , BigDecimal ( '-1' ) , BigDecimal ( '1' ) , 32
48+ end
49+
50+ def test_atanh
51+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
52+ BigMath , :atanh , BigDecimal ( '0.5' ) , 32
53+ end
54+
55+ def test_cbrt
56+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
57+ BigMath , :cbrt , BigDecimal ( '2' ) , 32
58+ end
59+
2560 def test_cos
2661 assert_send_type "(::BigDecimal x, ::Numeric prec) -> ::BigDecimal" ,
2762 BigMath , :cos , BigDecimal ( '1.23' ) , 10
2863 end
2964
65+ def test_cosh
66+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
67+ BigMath , :cosh , BigDecimal ( '1' ) , 32
68+ end
69+
3070 def test_exp
3171 assert_send_type "(::BigDecimal, ::Numeric prec) -> ::BigDecimal" ,
3272 BigMath , :exp , BigDecimal ( '1.23' ) , 10
3373 end
3474
75+ def test_hypot
76+ assert_send_type "(::BigDecimal, ::BigDecimal, ::Numeric) -> ::BigDecimal" ,
77+ BigMath , :hypot , BigDecimal ( '1' ) , BigDecimal ( '2' ) , 32
78+ end
79+
3580 def test_log
3681 assert_send_type "(::BigDecimal, ::Numeric prec) -> ::BigDecimal" ,
3782 BigMath , :log , BigDecimal ( '1.23' ) , 10
3883 end
3984
85+ def test_log2
86+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
87+ BigMath , :log2 , BigDecimal ( '3' ) , 32
88+ end
89+
4090 def test_sin
4191 assert_send_type "(::BigDecimal x, ::Numeric prec) -> ::BigDecimal" ,
4292 BigMath , :sin , BigDecimal ( '1.23' ) , 10
4393 end
4494
95+ def test_sinh
96+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
97+ BigMath , :sinh , BigDecimal ( '1' ) , 32
98+ end
99+
45100 def test_sqrt
46101 assert_send_type "(::BigDecimal x, ::Numeric prec) -> ::BigDecimal" ,
47102 BigMath , :sqrt , BigDecimal ( '1.23' ) , 10
48103 end
104+
105+ def test_tanh
106+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
107+ BigMath , :tanh , BigDecimal ( '1' ) , 32
108+ end
49109end
50110
51111class BigMathTest < Test ::Unit ::TestCase
@@ -67,23 +127,92 @@ def test_PI
67127 TestClass . new , :PI , 10
68128 end
69129
130+ def test_acos
131+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
132+ TestClass . new , :acos , BigDecimal ( '0.5' ) , 32
133+ end
134+
135+ def test_acosh
136+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
137+ TestClass . new , :acosh , BigDecimal ( '2' ) , 32
138+ end
139+
140+ def test_asin
141+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
142+ TestClass . new , :asin , BigDecimal ( '0.5' ) , 32
143+ end
144+
145+ def test_asinh
146+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
147+ TestClass . new , :asinh , BigDecimal ( '1' ) , 32
148+ end
149+
70150 def test_atan
71151 assert_send_type "(::BigDecimal x, ::Numeric prec) -> ::BigDecimal" ,
72152 TestClass . new , :atan , BigDecimal ( '1.23' ) , 10
73153 end
74154
155+ def test_atan2
156+ assert_send_type "(::BigDecimal, ::BigDecimal, ::Numeric) -> ::BigDecimal" ,
157+ TestClass . new , :atan2 , BigDecimal ( '-1' ) , BigDecimal ( '1' ) , 32
158+ end
159+
160+ def test_atanh
161+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
162+ TestClass . new , :atanh , BigDecimal ( '0.5' ) , 32
163+ end
164+
165+ def test_cbrt
166+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
167+ TestClass . new , :cbrt , BigDecimal ( '2' ) , 32
168+ end
169+
75170 def test_cos
76171 assert_send_type "(::BigDecimal x, ::Numeric prec) -> ::BigDecimal" ,
77172 TestClass . new , :cos , BigDecimal ( '1.23' ) , 10
78173 end
79174
175+ def test_cosh
176+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
177+ TestClass . new , :cosh , BigDecimal ( '1' ) , 32
178+ end
179+
180+ def test_exp
181+ assert_send_type "(::BigDecimal, ::Numeric prec) -> ::BigDecimal" ,
182+ TestClass . new , :exp , BigDecimal ( '1.23' ) , 10
183+ end
184+
185+ def test_hypot
186+ assert_send_type "(::BigDecimal, ::BigDecimal, ::Numeric) -> ::BigDecimal" ,
187+ TestClass . new , :hypot , BigDecimal ( '1' ) , BigDecimal ( '2' ) , 32
188+ end
189+
190+ def test_log
191+ assert_send_type "(::BigDecimal, ::Numeric prec) -> ::BigDecimal" ,
192+ TestClass . new , :log , BigDecimal ( '1.23' ) , 10
193+ end
194+
195+ def test_log2
196+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
197+ TestClass . new , :log2 , BigDecimal ( '3' ) , 32
198+ end
80199 def test_sin
81200 assert_send_type "(::BigDecimal x, ::Numeric prec) -> ::BigDecimal" ,
82201 TestClass . new , :sin , BigDecimal ( '1.23' ) , 10
83202 end
84203
204+ def test_sinh
205+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
206+ TestClass . new , :sinh , BigDecimal ( '1' ) , 32
207+ end
208+
85209 def test_sqrt
86210 assert_send_type "(::BigDecimal x, ::Numeric prec) -> ::BigDecimal" ,
87211 TestClass . new , :sqrt , BigDecimal ( '1.23' ) , 10
88212 end
213+
214+ def test_tanh
215+ assert_send_type "(::BigDecimal, ::Numeric) -> ::BigDecimal" ,
216+ TestClass . new , :tanh , BigDecimal ( '1' ) , 32
217+ end
89218end
0 commit comments