MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / main

Function main

maths/trapezoidal_rule.py:82–98  ·  view source on GitHub ↗

Main function to test the trapezoidal rule. :a: Lower bound of integration :b: Upper bound of integration :steps: define number of steps or resolution :boundary: define boundary of integration >>> main() y = 0.3349999999999999

()

Source from the content-addressed store, hash-verified

80
81
82def main():
83 """
84 Main function to test the trapezoidal rule.
85 :a: Lower bound of integration
86 :b: Upper bound of integration
87 :steps: define number of steps or resolution
88 :boundary: define boundary of integration
89
90 >>> main()
91 y = 0.3349999999999999
92 """
93 a = 0.0
94 b = 1.0
95 steps = 10.0
96 boundary = [a, b]
97 y = trapezoidal_rule(boundary, steps)
98 print(f"y = {y}")
99
100
101if __name__ == "__main__":

Callers 1

Calls 1

trapezoidal_ruleFunction · 0.85

Tested by

no test coverage detected