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

Method handle

Lib/_pydecimal.py:283–296  ·  view source on GitHub ↗
(self, context, sign, *args)

Source from the content-addressed store, hash-verified

281 """
282
283 def handle(self, context, sign, *args):
284 if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN,
285 ROUND_HALF_DOWN, ROUND_UP):
286 return _SignedInfinity[sign]
287 if sign == 0:
288 if context.rounding == ROUND_CEILING:
289 return _SignedInfinity[sign]
290 return _dec_from_triple(sign, '9'*context.prec,
291 context.Emax-context.prec+1)
292 if sign == 1:
293 if context.rounding == ROUND_FLOOR:
294 return _SignedInfinity[sign]
295 return _dec_from_triple(sign, '9'*context.prec,
296 context.Emax-context.prec+1)
297
298
299class Underflow(Inexact, Rounded, Subnormal):

Callers 1

_raise_errorMethod · 0.45

Calls 1

_dec_from_tripleFunction · 0.85

Tested by

no test coverage detected