mirror of
https://github.com/reactos/reactos.git
synced 2025-07-28 20:42:16 +00:00
Create a branch for audio work
svn path=/branches/audio-bringup/; revision=49478
This commit is contained in:
parent
26c20f3857
commit
5eb25b5c24
20759 changed files with 0 additions and 1141005 deletions
28
lib/sdk/crt/math/ldiv.c
Normal file
28
lib/sdk/crt/math/ldiv.c
Normal file
|
@ -0,0 +1,28 @@
|
|||
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
|
||||
#include <precomp.h>
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
ldiv_t
|
||||
ldiv(long num, long denom)
|
||||
{
|
||||
ldiv_t r;
|
||||
|
||||
if (num > 0 && denom < 0)
|
||||
{
|
||||
num = -num;
|
||||
denom = -denom;
|
||||
}
|
||||
r.quot = num / denom;
|
||||
r.rem = num % denom;
|
||||
if (num < 0 && denom > 0)
|
||||
{
|
||||
if (r.rem > 0)
|
||||
{
|
||||
r.quot++;
|
||||
r.rem -= denom;
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue