common: Use the correct magic number in Fixed15_49::pi_div_two().
authorTilman Sauerbeck <tilman@code-monkey.de>
Sun, 26 Apr 2020 10:36:45 +0000 (12:36 +0200)
committerTilman Sauerbeck <tilman@code-monkey.de>
Sun, 6 Sep 2020 17:57:17 +0000 (19:57 +0200)
This change should fix the display of current distance travelled
during a workout. It does not affect recordings.

src/common/fixed15_49.rs
test/gps_test.rs

index 6ce37febef3b632e3d3c9f921cf6f889078ec9ee..20ce88f47c4df7ba91638104e1621873a42540d0 100644 (file)
@@ -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 {
index 57c88991f5fcb6a7eb4c75900f3c75529b521d79..bba47fe9d4751427566cf3e40f0fa7fa6b8ece5c 100644 (file)
@@ -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));
 }