Python‎ > ‎decimal‎ > ‎

Decimal.next_plus()


Introduction
Return the smallest number representable in the given context (or in the current default context if no context is given) that is larger than the given operand.

Syntax
Decimal(x).next_plus()

Parameters
x=Decimal value

Examples
 >>> Decimal(1).next_plus()
Decimal('1.000000000000000000000000001')

>>> Decimal(0).next_plus()
Decimal('1E-1000026')

>>> Decimal(-1).next_plus()
Decimal('-0.9999999999999999999999999999')

>>> Decimal('infinity').next_plus()
Decimal('Infinity')
>>> 


Comments