From 853beae392e40ee2843e7187500285da666f11e9 Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Sun, 26 Apr 2020 12:36:45 +0200 Subject: [PATCH] common: Use the correct magic number in Fixed15_49::pi_div_two(). This change should fix the display of current distance travelled during a workout. It does not affect recordings. --- src/common/fixed15_49.rs | 2 +- test/gps_test.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/fixed15_49.rs b/src/common/fixed15_49.rs index 6ce37fe..20ce88f 100644 --- a/src/common/fixed15_49.rs +++ b/src/common/fixed15_49.rs @@ -97,7 +97,7 @@ impl Fixed15_49 { } pub fn pi_div_two() -> Self { - Self::from_bits(0x6487ed5110b46) + Self::from_bits(0x3243f6a8885a3) } pub fn to_radians(&self) -> Self { diff --git a/test/gps_test.rs b/test/gps_test.rs index 57c8899..bba47fe 100644 --- a/test/gps_test.rs +++ b/test/gps_test.rs @@ -111,5 +111,5 @@ fn distance_cm0() { longitude_rad: Fixed::from_f32(8.79443667).to_radians(), }; - assert_eq!(349, tap1.distance_cm(&tap0)); + assert_eq!(251, tap1.distance_cm(&tap0)); } -- 2.30.2