]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/DivS64x64Remainder.c
MdePkg/BaseLib: Add bit field population calculating methods
[mirror_edk2.git] / MdePkg / Library / BaseLib / DivS64x64Remainder.c
CommitLineData
e1f414b6 1/** @file\r
2 Math worker functions.\r
3\r
9095d37b 4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
bb817c56 5 This program and the accompanying materials\r
e1f414b6 6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
127010dd 8 http://opensource.org/licenses/bsd-license.php.\r
e1f414b6 9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
1efcc4ae 15\r
f734a10a 16\r
e1f414b6 17\r
18#include "BaseLibInternals.h"\r
19\r
20/**\r
21 Divides a 64-bit signed integer by a 64-bit signed integer and generates a\r
22 64-bit signed result and a optional 64-bit signed remainder.\r
23\r
24 This function divides the 64-bit signed value Dividend by the 64-bit signed\r
25 value Divisor and generates a 64-bit signed quotient. If Remainder is not\r
26 NULL, then the 64-bit signed remainder is returned in Remainder. This\r
27 function returns the 64-bit signed quotient.\r
28\r
cd2ed84a 29 It is the caller's responsibility to not call this function with a Divisor of 0.\r
9095d37b 30 If Divisor is 0, then the quotient and remainder should be assumed to be\r
9aa049d9 31 the largest negative integer.\r
32\r
e1f414b6 33 If Divisor is 0, then ASSERT().\r
34\r
35 @param Dividend A 64-bit signed value.\r
36 @param Divisor A 64-bit signed value.\r
37 @param Remainder A pointer to a 64-bit signed value. This parameter is\r
38 optional and may be NULL.\r
39\r
40 @return Dividend / Divisor\r
41\r
42**/\r
43INT64\r
44EFIAPI\r
45DivS64x64Remainder (\r
46 IN INT64 Dividend,\r
47 IN INT64 Divisor,\r
48 OUT INT64 *Remainder OPTIONAL\r
49 )\r
50{\r
51 ASSERT (Divisor != 0);\r
52 return InternalMathDivRemS64x64 (Dividend, Divisor, Remainder);\r
53}\r