GPS

Fork of GPS by Sam Clarke

Revision:
6:94e2037a8bc8
Parent:
5:96d5736d9613
Child:
7:1440e1e56a15
--- a/GPS.cpp	Sun Jan 19 08:47:38 2014 +0000
+++ b/GPS.cpp	Wed Feb 18 01:46:46 2015 +0000
@@ -32,55 +32,55 @@
             if(fixtype == 2) {
                 fix = "Differential";
             }
-            if(heading > 0.00 && heading < 45.00) {
+            if(heading > 0.0f && heading < 45.0f) {
                 cardinal = "NNE";
             }
-            if(heading == 45.00) {
+            if(heading == 45.0f) {
                 cardinal = "NE";
             }
-            if(heading > 45.00 && heading < 90.00) {
+            if(heading > 45.0f && heading < 90.0f) {
                 cardinal = "ENE";
             }
-            if(heading == 90.00) {
+            if(heading == 90.0f) {
                 cardinal = "E";
             }
-            if(heading > 90.00 && heading < 135.00) {
+            if(heading > 90.0f && heading < 135.0f) {
                 cardinal = "ESE";
             }
-            if(heading == 135.00) {
+            if(heading == 135.0f) {
                 cardinal = "SE";
             }
-            if(heading > 135.00 && heading < 180.00) {
+            if(heading > 135.0f && heading < 180.0f) {
                 cardinal = "SSE";
             }
-            if(heading == 180.00) {
+            if(heading == 180.0f) {
                 cardinal = "S";
             }
-            if(heading > 180.00 && heading < 225.00) {
+            if(heading > 180.0f && heading < 225.0f) {
                 cardinal = "SSW";
             }
-            if(heading == 225.00) {
+            if(heading == 225.0f) {
                 cardinal = "SW";
             }
-            if(heading > 225.00 && heading < 270.00) {
+            if(heading > 225.0f && heading < 270.0f) {
                 cardinal = "WSW";
             }
-            if(heading == 270.00) {
+            if(heading == 270.0f) {
                 cardinal = "W";
             }
-            if(heading > 270.00 && heading < 315.00) {
+            if(heading > 270.0f && heading < 315.0f) {
                 cardinal = "WNW";
             }
-            if(heading == 315.00) {
+            if(heading == 315.0f) {
                 cardinal = "NW";
             }
-            if(heading > 315.00 && heading < 360.00) {
+            if(heading > 315.0f && heading < 360.0f) {
                 cardinal = "NNW";
             }
-            if(heading == 360.00 || heading == 0.00) {
+            if(heading == 360.0f || heading == 0.0f) {
                 cardinal = "N";
             }
-            kph = speed*1.852;
+            kph = speed*1.852f;
             return 1;
         }
     }
@@ -89,10 +89,10 @@
 
 float GPS::trunc(float v)
 {
-    if(v < 0.0) {
-        v*= -1.0;
+    if(v < 0.0f) {
+        v*= -1.0f;
         v = floor(v);
-        v*=-1.0;
+        v*=-1.0f;
     } else {
         v = floor(v);
     }