MCPcopy Index your code
hub / github.com/RustPython/RustPython / __ceil__

Method __ceil__

Lib/_pydecimal.py:1858–1871  ·  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

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.

Callers

nothing calls this directly

Calls 2

is_nanMethod · 0.95
_rescaleMethod · 0.95

Tested by

no test coverage detected