mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Increase numerical precision of log1p
Use Rust native ln_1p to increase numerical precision matching what is expected by `test_mtestfile`.
This commit is contained in:
committed by
Jeong, YunWon
parent
cd1c9be0e1
commit
301c32dba0
@@ -147,7 +147,7 @@ mod math {
|
||||
fn log1p(x: ArgIntoFloat, vm: &VirtualMachine) -> PyResult<f64> {
|
||||
let x = *x;
|
||||
if x.is_nan() || x > -1.0_f64 {
|
||||
Ok((x + 1.0_f64).ln())
|
||||
Ok(x.ln_1p())
|
||||
} else {
|
||||
Err(vm.new_value_error("math domain error".to_owned()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user