TianoCore EDK2 master
Loading...
Searching...
No Matches
DivS64x64Remainder.c
Go to the documentation of this file.
1
9#include "BaseLibInternals.h"
10
28INT64
29EFIAPI
31 IN INT64 Dividend,
32 IN INT64 Divisor,
33 OUT INT64 *Remainder OPTIONAL
34 )
35{
36 INT64 Quot;
37
39 (UINT64)(Dividend >= 0 ? Dividend : -Dividend),
40 (UINT64)(Divisor >= 0 ? Divisor : -Divisor),
41 (UINT64 *)Remainder
42 );
43 if ((Remainder != NULL) && (Dividend < 0)) {
44 *Remainder = -*Remainder;
45 }
46
47 return (Dividend ^ Divisor) >= 0 ? Quot : -Quot;
48}
UINT64 EFIAPI InternalMathDivRemU64x64(IN UINT64 Dividend, IN UINT64 Divisor, OUT UINT64 *Remainder OPTIONAL)
Definition: Math64.c:320
INT64 EFIAPI InternalMathDivRemS64x64(IN INT64 Dividend, IN INT64 Divisor, OUT INT64 *Remainder OPTIONAL)
#define NULL
Definition: Base.h:319
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284