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

Function identity_function

maths/monte_carlo.py:82–88  ·  view source on GitHub ↗

Represents identity function >>> [function_to_integrate(x) for x in [-2.0, -1.0, 0.0, 1.0, 2.0]] [-2.0, -1.0, 0.0, 1.0, 2.0]

(x: float)

Source from the content-addressed store, hash-verified

80 """
81
82 def identity_function(x: float) -> float:
83 """
84 Represents identity function
85 >>> [function_to_integrate(x) for x in [-2.0, -1.0, 0.0, 1.0, 2.0]]
86 [-2.0, -1.0, 0.0, 1.0, 2.0]
87 """
88 return x
89
90 estimated_value = area_under_curve_estimator(
91 iterations, identity_function, min_value, max_value

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected