MCPcopy Index your code
hub / github.com/python/cpython / __ceil__

Method __ceil__

Lib/_pydecimal.py:1861–1874  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

is_nanMethod · 0.95
_rescaleMethod · 0.95

Tested by

no test coverage detected