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

Function f

maths/trapezoidal_rule.py:65–79  ·  view source on GitHub ↗

This is the function to integrate, f(x) = (x - 0)^2 = x^2. :param x: The input value :return: The value of f(x) >>> f(0) 0 >>> f(1) 1 >>> f(0.5) 0.25

(x)

Source from the content-addressed store, hash-verified

63
64
65def f(x):
66 """
67 This is the function to integrate, f(x) = (x - 0)^2 = x^2.
68
69 :param x: The input value
70 :return: The value of f(x)
71
72 >>> f(0)
73 0
74 >>> f(1)
75 1
76 >>> f(0.5)
77 0.25
78 """
79 return x**2
80
81
82def main():

Callers 1

trapezoidal_ruleFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected