Returns a copy, unless it is a sNaN. Rounds the number (if more than precision digits)
(self, context=None)
| 1066 | return ans._fix(context) |
| 1067 | |
| 1068 | def __pos__(self, context=None): |
| 1069 | """Returns a copy, unless it is a sNaN. |
| 1070 | |
| 1071 | Rounds the number (if more than precision digits) |
| 1072 | """ |
| 1073 | if self._is_special: |
| 1074 | ans = self._check_nans(context=context) |
| 1075 | if ans: |
| 1076 | return ans |
| 1077 | |
| 1078 | if context is None: |
| 1079 | context = getcontext() |
| 1080 | |
| 1081 | if not self and context.rounding != ROUND_FLOOR: |
| 1082 | # + (-0) = 0, except in ROUND_FLOOR rounding mode. |
| 1083 | ans = self.copy_abs() |
| 1084 | else: |
| 1085 | ans = Decimal(self) |
| 1086 | |
| 1087 | return ans._fix(context) |
| 1088 | |
| 1089 | def __abs__(self, round=True, context=None): |
| 1090 | """Returns the absolute value of self. |
no test coverage detected