Return the ceiling of self, as an integer. For a finite Decimal instance self, return the least integer n such that n >= self. If self is infinite or a NaN then a Python exception is raised.
(self)
| 1915 | return int(self._rescale(0, ROUND_FLOOR)) |
| 1916 | |
| 1917 | def __ceil__(self): |
| 1918 | """Return the ceiling of self, as an integer. |
| 1919 | |
| 1920 | For a finite Decimal instance self, return the least integer n |
| 1921 | such that n >= self. If self is infinite or a NaN then a |
| 1922 | Python exception is raised. |
| 1923 | |
| 1924 | """ |
| 1925 | if self._is_special: |
| 1926 | if self.is_nan(): |
| 1927 | raise ValueError("cannot round a NaN") |
| 1928 | else: |
| 1929 | raise OverflowError("cannot round an infinity") |
| 1930 | return int(self._rescale(0, ROUND_CEILING)) |
| 1931 | |
| 1932 | def fma(self, other, third, context=None): |
| 1933 | """Fused multiply-add. |