mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 13:18:19 +00:00
LibC: Add imaxdiv and lldiv
This commit is contained in:
parent
42a8186728
commit
857b0e1dc3
Notes:
sideshowbarker
2024-07-18 21:36:14 +09:00
Author: https://github.com/RealKC
Commit: 857b0e1dc3
Pull-request: https://github.com/SerenityOS/serenity/pull/5688
Issue: https://github.com/SerenityOS/serenity/issues/4282
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/BenWiederhake
Reviewed-by: https://github.com/awesomekling
5 changed files with 74 additions and 0 deletions
|
@ -836,6 +836,19 @@ ldiv_t ldiv(long numerator, long denominator)
|
|||
return result;
|
||||
}
|
||||
|
||||
lldiv_t lldiv(long long numerator, long long denominator)
|
||||
{
|
||||
lldiv_t result;
|
||||
result.quot = numerator / denominator;
|
||||
result.rem = numerator % denominator;
|
||||
|
||||
if (numerator >= 0 && result.rem < 0) {
|
||||
result.quot++;
|
||||
result.rem -= denominator;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
size_t mbstowcs(wchar_t*, const char*, size_t)
|
||||
{
|
||||
dbgln("FIXME: Implement mbstowcs()");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue