]>
Commit | Line | Data |
---|---|---|
e1f414b6 | 1 | /** @file\r |
2 | Math worker functions.\r | |
3 | \r | |
9095d37b | 4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
e1f414b6 | 6 | \r |
7 | **/\r | |
8 | \r | |
1efcc4ae | 9 | \r |
f734a10a | 10 | \r |
e1f414b6 | 11 | \r |
12 | #include "BaseLibInternals.h"\r | |
13 | \r | |
14 | /**\r | |
15 | Divides a 64-bit signed integer by a 64-bit signed integer and generates a\r | |
16 | 64-bit signed result and a optional 64-bit signed remainder.\r | |
17 | \r | |
18 | This function divides the 64-bit signed value Dividend by the 64-bit signed\r | |
19 | value Divisor and generates a 64-bit signed quotient. If Remainder is not\r | |
20 | NULL, then the 64-bit signed remainder is returned in Remainder. This\r | |
21 | function returns the 64-bit signed quotient.\r | |
22 | \r | |
cd2ed84a | 23 | It is the caller's responsibility to not call this function with a Divisor of 0.\r |
9095d37b | 24 | If Divisor is 0, then the quotient and remainder should be assumed to be\r |
9aa049d9 | 25 | the largest negative integer.\r |
26 | \r | |
e1f414b6 | 27 | If Divisor is 0, then ASSERT().\r |
28 | \r | |
29 | @param Dividend A 64-bit signed value.\r | |
30 | @param Divisor A 64-bit signed value.\r | |
31 | @param Remainder A pointer to a 64-bit signed value. This parameter is\r | |
32 | optional and may be NULL.\r | |
33 | \r | |
34 | @return Dividend / Divisor\r | |
35 | \r | |
36 | **/\r | |
37 | INT64\r | |
38 | EFIAPI\r | |
39 | DivS64x64Remainder (\r | |
40 | IN INT64 Dividend,\r | |
41 | IN INT64 Divisor,\r | |
42 | OUT INT64 *Remainder OPTIONAL\r | |
43 | )\r | |
44 | {\r | |
45 | ASSERT (Divisor != 0);\r | |
46 | return InternalMathDivRemS64x64 (Dividend, Divisor, Remainder);\r | |
47 | }\r |