diff --git a/stdlib/src/math.rs b/stdlib/src/math.rs index 9ab4bed5ce..524660a434 100644 --- a/stdlib/src/math.rs +++ b/stdlib/src/math.rs @@ -147,7 +147,7 @@ mod math { fn log1p(x: ArgIntoFloat, vm: &VirtualMachine) -> PyResult { 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())) }