From 5405811eaa2af3e84cc3423010488d8429657bb8 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Fri, 20 Jan 2023 17:49:23 -0330 Subject: round displacement when converting units --- src/volume.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/volume.rs') diff --git a/src/volume.rs b/src/volume.rs index 933ae49..5818ea4 100644 --- a/src/volume.rs +++ b/src/volume.rs @@ -41,7 +41,7 @@ impl CubicMetre { impl From for CubicMetre { fn from(value: Litre) -> Self { - Self(value.0 * 10_f64.powf(-3.)) + Self(value.0 * 10_f64.powi(-3)) } } @@ -56,7 +56,7 @@ impl> From for Litre { impl From for Litre { fn from(value: CubicMetre) -> Self { - Self(value.0 * 10_f64.powf(3.)) + Self(value.0 * 10_f64.powi(3)) } } -- cgit v1.2.3