This repository was archived by the owner on Dec 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -281,6 +281,14 @@ public function tan($scale = null)
281
281
);
282
282
}
283
283
284
+ public function cotan ($ scale = null )
285
+ {
286
+ throw new \DomainException (($ this === self ::$ pInf ) ?
287
+ "Cotangent function hasn't limit in the positive infinite. " :
288
+ "Cotangent function hasn't limit in the negative infinite. "
289
+ );
290
+ }
291
+
284
292
/**
285
293
* @return boolean
286
294
*/
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ use Litipk \BigNumbers \InfiniteDecimal as InfiniteDecimal ;
4
+
5
+ /**
6
+ * @group cotan
7
+ */
8
+ class InfiniteDecimalCotanTest extends PHPUnit_Framework_TestCase
9
+ {
10
+ /**
11
+ * @expectedException \DomainException
12
+ * @expectedExceptionMessage Cotangent function hasn't limit in the positive infinite.
13
+ */
14
+ public function testFinitePositiveInfiniteCotan ()
15
+ {
16
+ InfiniteDecimal::getPositiveInfinite ()->cotan ();
17
+ }
18
+
19
+ /**
20
+ * @expectedException \DomainException
21
+ * @expectedExceptionMessage Cotangent function hasn't limit in the negative infinite.
22
+ */
23
+ public function testFiniteNegativeInfiniteCotan ()
24
+ {
25
+ InfiniteDecimal::getNegativeInfinite ()->cotan ();
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments