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)
| 1856 | return int(self._rescale(0, ROUND_FLOOR)) |
| 1857 | |
| 1858 | def __ceil__(self): |
| 1859 | """Return the ceiling of self, as an integer. |
| 1860 | |
| 1861 | For a finite Decimal instance self, return the least integer n |
| 1862 | such that n >= self. If self is infinite or a NaN then a |
| 1863 | Python exception is raised. |
| 1864 | |
| 1865 | """ |
| 1866 | if self._is_special: |
| 1867 | if self.is_nan(): |
| 1868 | raise ValueError("cannot round a NaN") |
| 1869 | else: |
| 1870 | raise OverflowError("cannot round an infinity") |
| 1871 | return int(self._rescale(0, ROUND_CEILING)) |
| 1872 | |
| 1873 | def fma(self, other, third, context=None): |
| 1874 | """Fused multiply-add. |