diff options
author | Linus Groh <mail@linusgroh.de> | 2021-11-14 22:48:57 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-11-14 23:08:40 +0000 |
commit | a3de9dcf951eaff6d07b0818c32a5c80eccd6d5e (patch) | |
tree | f35f56138d541af92fa34e7d7c7591872876032c /Userland/Libraries/LibJS/Runtime | |
parent | b1d5d3cc341a13c15bcde58bf8bee95096b59425 (diff) | |
download | serenity-a3de9dcf951eaff6d07b0818c32a5c80eccd6d5e.zip |
LibJS: Fix incorrect use of "modulo" in balance_iso_year_month()
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp index 7996692ff8..a32ec83ae9 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp @@ -180,7 +180,7 @@ ISOYearMonth balance_iso_year_month(double year, double month) year += floor((month - 1) / 12); // 3. Set month to (month − 1) modulo 12 + 1. - month = fmod(month - 1, 12) + 1; + month = modulo(month - 1, 12.0) + 1; // 4. Return the Record { [[Year]]: year, [[Month]]: month }. return ISOYearMonth { .year = static_cast<i32>(year), .month = static_cast<u8>(month), .reference_iso_day = 0 }; |