Skip to content

Commit 3752645

Browse files
fix: memperbaiki variabel algoritma rieman
1 parent 6db4249 commit 3752645

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

math/rieman_integral.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ def f(x):
4848
print(rieman_integral(f, 0, 1, 1, "tengah")) # 0.5
4949

5050
# persamaan 4/(1+x^2)
51-
def f(x):
51+
def g(x):
5252
return (4) / (1 + x**2)
53-
print(rieman_integral(f, 0, 1, 1000, "tengah")) # 3.1415927369231227
53+
print(rieman_integral(g, 0, 1, 1000, "tengah")) # 3.1415927369231227
5454

5555
# Persamaan sin
56-
def f(x):
56+
def y(x):
5757
return math.sin(x)
58-
print(rieman_integral(f, 0, math.pi / 2, 100, "kiri")) # 0.9921254566056331
58+
print(rieman_integral(y, 0, math.pi / 2, 100, "kiri")) # 0.9921254566056331
5959

6060

6161
if __name__ == "__main__":

0 commit comments

Comments
 (0)