1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:27:35 +00:00

LibJS: Fix incorrect use of "modulo" in balance_iso_year_month()

This commit is contained in:
Linus Groh 2021-11-14 22:48:57 +00:00
parent b1d5d3cc34
commit a3de9dcf95

View file

@ -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 };