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:
[in] Value Source value from where to extract the digits from
[out] pOut Destination buffer which receives the extracted digits
[in] 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 Apr 9 16:39:01 2007 for HEL Library by  doxygen 1.5.1