From: Tilman Sauerbeck Date: Sun, 26 Apr 2020 10:36:45 +0000 (+0200) Subject: common: Use the correct magic number in Fixed15_49::pi_div_two(). X-Git-Url: http://git.code-monkey.de/?a=commitdiff_plain;h=853beae392e40ee2843e7187500285da666f11e9;p=gps-watch.git 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. --- 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)); }