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:
parent
1ec917aa23
commit
9c209b8079
5 changed files with 15 additions and 14 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue