Main Page | Modules | Related Pages

Math Functions

Functions


Function Documentation

void hel_MathExtractDigits u32  Value,
u8 *  pOut,
u32  nDigits
 

Extract digits from a value.

The hel_MathExtractDigits can be used to extract digits from a given value. This is handy when dealing with score display.

Parameters:
Value Source value from where to extract the digits from
pOut Destination buffer which receives the extracted digits
nDigits Amount of digits to extract
The following example extracts the digits from 1234. The result is stored in Buffer which will contain the following values afterwards: 1,2,3,4
    u8 Buffer[4];

    hel_MathExtractDigits(1234, Buffer, 4);

Note:
The same result can be achieved with some C modulus/sprintf/whatever. Obviously, this slow! hel_MathExtractDigits is more designed for speed. It uses the BIOS functions instead.


Generated on Mon Aug 22 20:43:41 2005 by DoxyGen 1.4.4