mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
Implement __floor__ for float type
Co-authored-by: Tetramad <cbwjd777@gmail.com>
This commit is contained in:
committed by
Tetramad
parent
fae7b0e8ed
commit
95b514b85d
@@ -389,6 +389,11 @@ impl PyFloat {
|
||||
try_bigint(self.value, vm)
|
||||
}
|
||||
|
||||
#[pymethod(magic)]
|
||||
fn floor(&self, vm: &VirtualMachine) -> PyResult<BigInt> {
|
||||
try_bigint(self.value.floor(), vm)
|
||||
}
|
||||
|
||||
#[pymethod(magic)]
|
||||
fn ceil(&self, vm: &VirtualMachine) -> PyResult<BigInt> {
|
||||
try_bigint(self.value.ceil(), vm)
|
||||
|
||||
Reference in New Issue
Block a user