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

LibJS: Support modulo(x, y) with different types

It's a bit annoying having to add '.0' to y given that it's an integral
number in most cases.
This turns the single template parameter T into T and U to permit that.
This commit is contained in:
Linus Groh 2021-12-21 21:22:38 +01:00
parent 1ec917aa23
commit 9c209b8079
5 changed files with 15 additions and 14 deletions

View file

@ -311,7 +311,7 @@ u16 ms_from_time(double t)
u8 week_day(double t)
{
// 𝔽((Day(t) + 4𝔽) modulo 7)
return static_cast<u8>(modulo(day(t) + 4, 7.0));
return static_cast<u8>(modulo(day(t) + 4, 7));
}
// 21.4.1.11 MakeTime ( hour, min, sec, ms ), https://tc39.es/ecma262/#sec-maketime