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