Compares two arbitrary-precision integers specified with vectors of bytes in the Little-Endian order.
- Parameters
-
[in] | pX | A pointer to a vector of cbX bytes representing the first integer. |
| cbX | A byte size of the first integer. |
[in] | pY | A pointer to a vector of cbY bytes representing the second integer. |
| cbY | A byte size of the second integer. |
- Returns
- A negative value, if the first integer is less then the second integer, a positive value if the first integer is greater than the second integer, otherwise the return value is zero.
Let b = 2CHAR_BIT
be a number of values that can be represented using one byte, nx = cbX - 1
, and ny = cbY - 1
. Assuming that pX
points to the vector \(V_X = \{x_0,\dots,x_{n_x}\}\), where \(x_0\) is the first element of the vector \(V_X\), and pY
points to the vector \(V_Y = \{y_0,\dots,y_{n_y}\}\), where \(y_0\) is the first element of the vector \(V_Y\), the function compares the corresponding Little-Endian integers \(X = \sum_{i=0}^{n_x}x_i\cdot b^i\) and \(Y = \sum_{i=0}^{n_y}y_i\cdot b^i\) and returns a negative value, if \(V_X < V_Y\); zero, if \(V_X = V_Y\), and a positive value, if \(V_X > V_Y\).
- See also
- memcmp_BE.