diff --git a/py/objstr.c b/py/objstr.c
index 01ed3a2d3bd2bfc2c98334804349a8ee9cb204e6..879d1853d9ecf7dc36daa46ce487d0b4db6eb02c 100644
--- a/py/objstr.c
+++ b/py/objstr.c
@@ -1206,7 +1206,13 @@ mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwa
 
                 case '%':
                     flags |= PF_FLAG_ADD_PERCENT;
-                    pfenv_print_float(&pfenv_vstr, mp_obj_get_float(arg) * 100.0F, 'f', flags, fill, width, precision);
+                    #if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT
+                    #define F100 100.0F
+                    #else
+                    #define F100 100.0
+                    #endif
+                    pfenv_print_float(&pfenv_vstr, mp_obj_get_float(arg) * F100, 'f', flags, fill, width, precision);
+                    #undef F100
                     break;
 #endif
 
diff --git a/unix/modtime.c b/unix/modtime.c
index 2efb7fab361c3da159647cf43b3de7b415385b0d..61b5e0dd53bd633df9e357c3e491e68fdaaff7b1 100644
--- a/unix/modtime.c
+++ b/unix/modtime.c
@@ -52,7 +52,7 @@ void msec_sleep_tv(struct timeval *tv) {
 #endif
 
 #if defined(MP_CLOCKS_PER_SEC)
-#define CLOCK_DIV (MP_CLOCKS_PER_SEC / 1000.0)
+#define CLOCK_DIV (MP_CLOCKS_PER_SEC / 1000.0F)
 #else
 #error Unsupported clock() implementation
 #endif