We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4fe723c commit 99cc2d5Copy full SHA for 99cc2d5
test/bigdecimal/test_bigmath.rb
@@ -13,9 +13,20 @@ class TestBigMath < Test::Unit::TestCase
13
MINF = BigDecimal("-Infinity")
14
NAN = BigDecimal("NaN")
15
16
- def test_const
17
- assert_in_delta(Math::PI, PI(N))
18
- assert_in_delta(Math::E, E(N))
+ def test_pi
+ assert_equal(
+ BigDecimal("3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068"),
19
+ PI(100).round(100)
20
+ )
21
+ assert_relative_precision {|n| PI(n) }
22
+ end
23
+
24
+ def test_e
25
26
+ BigDecimal("2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427"),
27
+ E(100)
28
29
+ assert_relative_precision {|n| E(n) }
30
end
31
32
def test_sqrt
0 commit comments