MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __ceil__

Method __ceil__

tools/python-3.11.9-amd64/Lib/_pydecimal.py:1917–1930  ·  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

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.

Callers

nothing calls this directly

Calls 2

is_nanMethod · 0.95
_rescaleMethod · 0.95

Tested by

no test coverage detected