mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:47:34 +00:00
LibC: Add imaxdiv and lldiv
This commit is contained in:
parent
42a8186728
commit
857b0e1dc3
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