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

Method __repr__

maths/dual_number_automatic_differentiation.py:19–21  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

17 self.duals = rank
18
19 def __repr__(self):
20 s = "+".join(f"{dual}E{n}" for n, dual in enumerate(self.duals, 1))
21 return f"{self.real}+{s}"
22
23 def reduce(self):
24 cur = self.duals.copy()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected