diff options
author | Linus Groh <mail@linusgroh.de> | 2021-12-21 21:22:38 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-12-22 11:27:31 +0100 |
commit | 9c209b80793b7717ba5a3973722e0b5941696cfd (patch) | |
tree | ef7f0c9e78db2198bf376613405515f2d5bf7eaa /Userland/Libraries/LibJS/Runtime/Date.cpp | |
parent | 1ec917aa23dbc0e3d95e0dfe5f279971789cfcb8 (diff) | |
download | serenity-9c209b80793b7717ba5a3973722e0b5941696cfd.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Date.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Date.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Date.cpp b/Userland/Libraries/LibJS/Runtime/Date.cpp index 95770459f8..f68f27f307 100644 --- a/Userland/Libraries/LibJS/Runtime/Date.cpp +++ b/Userland/Libraries/LibJS/Runtime/Date.cpp @@ -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 |