Returns a copy, unless it is a sNaN. Rounds the number (if more than precision digits)
(self, context=None)
| 1122 | return ans._fix(context) |
| 1123 | |
| 1124 | def __pos__(self, context=None): |
| 1125 | """Returns a copy, unless it is a sNaN. |
| 1126 | |
| 1127 | Rounds the number (if more than precision digits) |
| 1128 | """ |
| 1129 | if self._is_special: |
| 1130 | ans = self._check_nans(context=context) |
| 1131 | if ans: |
| 1132 | return ans |
| 1133 | |
| 1134 | if context is None: |
| 1135 | context = getcontext() |
| 1136 | |
| 1137 | if not self and context.rounding != ROUND_FLOOR: |
| 1138 | # + (-0) = 0, except in ROUND_FLOOR rounding mode. |
| 1139 | ans = self.copy_abs() |
| 1140 | else: |
| 1141 | ans = Decimal(self) |
| 1142 | |
| 1143 | return ans._fix(context) |
| 1144 | |
| 1145 | def __abs__(self, round=True, context=None): |
| 1146 | """Returns the absolute value of self. |
no test coverage detected