hbui
2024-07-19 a8c5c3a4ebe77a372a991c0fa8a557292fc5ea8e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import sys
import unittest
from numint.RiemannSum import split, numint, numint_compact
 
 
class RiemannSumTestCase(unittest.TestCase):
 
    def test_split_interval(self):
        split(iteration=6)
 
    def test_numint(self):
        def fn(x) : return x**2
        (a, b) = (0, 2)
        (l, r) = numint(fn, a, b)
        print(l, r)
        pass
 
    def test_numint_compact(self):
        def fn(x) : return x**2
        (a, b) = (0, 2)
        (l, r) = numint_compact(fn, a, b, epsilon=1E9 * sys.float_info.epsilon)
        print(l, r)
        pass
 
 
 
 
if __name__ == '__main__':
    unittest.main()