File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,20 @@ class TestBigMath < Test::Unit::TestCase
10
10
MINF = BigDecimal ( "-Infinity" )
11
11
NAN = BigDecimal ( "NaN" )
12
12
13
- def test_const
14
- assert_in_delta ( Math ::PI , PI ( N ) )
15
- assert_in_delta ( Math ::E , E ( N ) )
13
+ def test_PI
14
+ eps = "1e-#{ Float ::DIG } " . to_f
15
+ assert_in_delta ( Math ::PI , PI ( N ) , eps )
16
+ assert_in_delta ( BigDecimal ( "3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068" ) ,
17
+ PI ( 100 ) ,
18
+ BigDecimal ( "1e-100" ) )
19
+ end
20
+
21
+ def test_E
22
+ eps = "1e-#{ Float ::DIG } " . to_f
23
+ assert_in_delta ( Math ::E , E ( N ) , eps )
24
+ assert_in_delta ( BigDecimal ( "2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427" ) ,
25
+ E ( 100 ) ,
26
+ BigDecimal ( "1e-100" ) )
16
27
end
17
28
18
29
def test_sqrt
You can’t perform that action at this time.
0 commit comments