MCPcopy Index your code
hub / github.com/RustPython/RustPython / handle

Method handle

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

Source from the content-addressed store, hash-verified

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

Callers 1

_raise_errorMethod · 0.45

Calls 1

_dec_from_tripleFunction · 0.85

Tested by

no test coverage detected