diff --git a/tests/periph_ptp_clock/main.c b/tests/periph_ptp_clock/main.c index ef7a21d247..425573fcf1 100644 --- a/tests/periph_ptp_clock/main.c +++ b/tests/periph_ptp_clock/main.c @@ -67,7 +67,8 @@ static int test_speed_adjustment(const int32_t speed) print_str(" (~"); { int64_t tmp = speed * 100000ULL; - tmp /= UINT32_MAX; + /* trusting compiler to use arithmetic right shift, when available instead of division */ + tmp /= 1LL << 32; tmp += 100000ULL; char output[16]; print(output, fmt_s32_dfp(output, (int32_t)tmp, -3));