Skip to content

Commit 85525c7

Browse files
committed
Use MICROPY_FLOAT_CONST
1 parent f7c4a22 commit 85525c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shared-bindings/time/__init__.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
//|
6666
STATIC mp_obj_t time_monotonic(void) {
6767
uint64_t ticks_ms = common_hal_time_monotonic_ms();
68-
return mp_obj_new_float(uint64_to_float(ticks_ms) / 1000.0f);
68+
return mp_obj_new_float(uint64_to_float(ticks_ms) / MICROPY_FLOAT_CONST(1000.0));
6969
}
7070
MP_DEFINE_CONST_FUN_OBJ_0(time_monotonic_obj, time_monotonic);
7171

@@ -78,7 +78,7 @@ MP_DEFINE_CONST_FUN_OBJ_0(time_monotonic_obj, time_monotonic);
7878
STATIC mp_obj_t time_sleep(mp_obj_t seconds_o) {
7979
#if MICROPY_PY_BUILTINS_FLOAT
8080
mp_float_t seconds = mp_obj_get_float(seconds_o);
81-
mp_float_t msecs = 1000.0f * seconds + 0.5f;
81+
mp_float_t msecs = MICROPY_FLOAT_CONST(1000.0) * seconds + MICROPY_FLOAT_CONST(0.5);
8282
#else
8383
mp_int_t seconds = mp_obj_get_int(seconds_o);
8484
mp_int_t msecs = 1000 * seconds;

0 commit comments

Comments
 (0)