normalize reduces an operand to its simplest form. Essentially a plus operation with all trailing zeros removed from the result. >>> ExtendedContext.normalize(Decimal('2.1')) Decimal('2.1') >>> ExtendedContext.normalize(Decimal('-2.0')) Decim
(self, a)
| 5062 | return a.next_toward(b, context=self) |
| 5063 | |
| 5064 | def normalize(self, a): |
| 5065 | """normalize reduces an operand to its simplest form. |
| 5066 | |
| 5067 | Essentially a plus operation with all trailing zeros removed from the |
| 5068 | result. |
| 5069 | |
| 5070 | >>> ExtendedContext.normalize(Decimal('2.1')) |
| 5071 | Decimal('2.1') |
| 5072 | >>> ExtendedContext.normalize(Decimal('-2.0')) |
| 5073 | Decimal('-2') |
| 5074 | >>> ExtendedContext.normalize(Decimal('1.200')) |
| 5075 | Decimal('1.2') |
| 5076 | >>> ExtendedContext.normalize(Decimal('-120')) |
| 5077 | Decimal('-1.2E+2') |
| 5078 | >>> ExtendedContext.normalize(Decimal('120.00')) |
| 5079 | Decimal('1.2E+2') |
| 5080 | >>> ExtendedContext.normalize(Decimal('0.00')) |
| 5081 | Decimal('0') |
| 5082 | >>> ExtendedContext.normalize(6) |
| 5083 | Decimal('6') |
| 5084 | """ |
| 5085 | a = _convert_other(a, raiseit=True) |
| 5086 | return a.normalize(context=self) |
| 5087 | |
| 5088 | def number_class(self, a): |
| 5089 | """Returns an indication of the class of the operand. |
nothing calls this directly
no test coverage detected