From aaa9524a527713aef10b11a08b98c05d326ab535 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Tue, 14 Jun 2022 23:43:45 +0100 Subject: [PATCH] LibJS: Add parentheses around modulo operation This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/90e4b34 --- Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp index cf8663e025..d34e996a84 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp @@ -176,7 +176,7 @@ ISOYearMonth balance_iso_year_month(double year, double month) // 2. Set year to year + floor((month - 1) / 12). year += floor((month - 1) / 12); - // 3. Set month to (month - 1) modulo 12 + 1. + // 3. Set month to ((month - 1) modulo 12) + 1. month = modulo(month - 1, 12) + 1; // 4. Return the Record { [[Year]]: year, [[Month]]: month }.