MCPcopy Create free account
hub / github.com/ActiveState/code / error

Method error

recipes/Python/265894_Floating_Point_Simulator/recipe-265894.py:13–15  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

11 def __repr__(self):
12 return "F(%s, %r)" % (self, self.full)
13 def error(self):
14 ulp = float('1'+('%.4e' % self.value)[-5:]) * 10 ** (1-prec)
15 return int(abs(self.value - self.full) / ulp)
16 def __coerce__(self, other):
17 if not isinstance(other, F):
18 return (self, F(other))

Callers 4

handle_requestMethod · 0.45
recipe-265894.pyFile · 0.45
code_blockFunction · 0.45
recipe-259097.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected