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

Method next_plus

Lib/_pydecimal.py:4976–4994  ·  view source on GitHub ↗

Returns the smallest representable number larger than a. >>> c = ExtendedContext.copy() >>> c.Emin = -999 >>> c.Emax = 999 >>> ExtendedContext.next_plus(Decimal('1')) Decimal('1.00000001') >>> c.next_plus(Decimal('-1E-1007')) Decimal('-0E-1007

(self, a)

Source from the content-addressed store, hash-verified

4974 return a.next_minus(context=self)
4975
4976 def next_plus(self, a):
4977 """Returns the smallest representable number larger than a.
4978
4979 >>> c = ExtendedContext.copy()
4980 >>> c.Emin = -999
4981 >>> c.Emax = 999
4982 >>> ExtendedContext.next_plus(Decimal('1'))
4983 Decimal('1.00000001')
4984 >>> c.next_plus(Decimal('-1E-1007'))
4985 Decimal('-0E-1007')
4986 >>> ExtendedContext.next_plus(Decimal('-1.00000003'))
4987 Decimal('-1.00000002')
4988 >>> c.next_plus(Decimal('-Infinity'))
4989 Decimal('-9.99999999E+999')
4990 >>> c.next_plus(1)
4991 Decimal('1.00000001')
4992 """
4993 a = _convert_other(a, raiseit=True)
4994 return a.next_plus(context=self)
4995
4996 def next_toward(self, a, b):
4997 """Returns the number closest to a, in direction towards b.

Callers 1

test_next_plusMethod · 0.95

Calls 2

_convert_otherFunction · 0.85
next_plusMethod · 0.45

Tested by 1

test_next_plusMethod · 0.76