MCPcopy Index your code
hub / github.com/python/cpython / _WorkRep

Class _WorkRep

Lib/_pydecimal.py:5595–5617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5593 to_integral = to_integral_value
5594
5595class _WorkRep(object):
5596 __slots__ = ('sign','int','exp')
5597 # sign: 0 or 1
5598 # int: int
5599 # exp: None, int, or string
5600
5601 def __init__(self, value=None):
5602 if value is None:
5603 self.sign = None
5604 self.int = 0
5605 self.exp = None
5606 elif isinstance(value, Decimal):
5607 self.sign = value._sign
5608 self.int = int(value._int)
5609 self.exp = value._exp
5610 else:
5611 # assert isinstance(value, tuple)
5612 self.sign = value[0]
5613 self.int = value[1]
5614 self.exp = value[2]
5615
5616 def __repr__(self):
5617 return "(%r, %r, %r)" % (self.sign, self.int, self.exp)
5618
5619
5620

Callers 14

__add__Method · 0.85
__mul__Method · 0.85
__truediv__Method · 0.85
_divideMethod · 0.85
remainder_nearMethod · 0.85
_power_moduloMethod · 0.85
_power_exactMethod · 0.85
__pow__Method · 0.85
sqrtMethod · 0.85
expMethod · 0.85
_ln_exp_boundMethod · 0.85
lnMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…