diff --git a/libraries/AP_Math/examples/eulers/eulers.pde b/libraries/AP_Math/examples/eulers/eulers.pde index 47575ef8b1..4f310f35e3 100644 --- a/libraries/AP_Math/examples/eulers/eulers.pde +++ b/libraries/AP_Math/examples/eulers/eulers.pde @@ -268,7 +268,7 @@ void test_frame_transforms(void) static float rand_num(void) { float ret = ((unsigned)random()) % 2000000; - return (ret - 1.0e6) / 1.0e6; + return (ret - 1.0e6f) / 1.0e6f; } void test_matrix_rotate(void) diff --git a/libraries/AP_Math/examples/location/location.pde b/libraries/AP_Math/examples/location/location.pde index 0f763ccbec..184b9dd4ad 100644 --- a/libraries/AP_Math/examples/location/location.pde +++ b/libraries/AP_Math/examples/location/location.pde @@ -69,8 +69,8 @@ static const struct { static struct Location location_from_point(Vector2f pt) { struct Location loc = {0}; - loc.lat = pt.x * 1.0e7; - loc.lng = pt.y * 1.0e7; + loc.lat = pt.x * 1.0e7f; + loc.lng = pt.y * 1.0e7f; return loc; } @@ -130,8 +130,8 @@ static void test_offset(void) { struct Location loc; - loc.lat = -35*1.0e7; - loc.lng = 149*1.0e7; + loc.lat = -35*1.0e7f; + loc.lng = 149*1.0e7f; for (uint8_t i=0; iprintf_P(PSTR("%10f,%10f %s %s\n"), - 1.0e-7*test_points[i].point.x, - 1.0e-7*test_points[i].point.y, + 1.0e-7f*test_points[i].point.x, + 1.0e-7f*test_points[i].point.y, result ? "OUTSIDE" : "INSIDE ", result == test_points[i].outside ? "PASS" : "FAIL"); if (result != test_points[i].outside) { diff --git a/libraries/AP_Math/examples/rotations/rotations.pde b/libraries/AP_Math/examples/rotations/rotations.pde index b6141b5ffd..7ebe620e8d 100644 --- a/libraries/AP_Math/examples/rotations/rotations.pde +++ b/libraries/AP_Math/examples/rotations/rotations.pde @@ -81,7 +81,7 @@ static void test_euler(enum Rotation rotation, float roll, float pitch, float ya { Vector3f v, v1, v2, diff; Matrix3f rotmat; - const float accuracy = 1.0e-6; + const float accuracy = 1.0e-6f; v.x = 1; v.y = 2;