PURPOSE
: Convert from positive integer 10 base number system to other base number
system > 1.
SYNTAX
: [number:Integer
, radix:Integer
] call
fNumBaseConvert
RETURNS
: Array
Array filled with numbers which can be used with the symbols of
the target number system to assemble a meaningful string.
Empty array on error.
EXAMPLES
:
176 to binary
_binarySymbols = ["0","1"];
_binaryRadix = count _binarySymbols; (-> 2)
_symbolReference = [176,_binaryRadix] call fNumBaseConvert
_symbolReference -> [1,0,1,1,0,0,0,0]
176 to hex
_hexSymbols = ["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];
_hexRadix = count _hexSymbols; (-> 16)
_symbolReference = [176,_hexRadix] call fNumBaseConvert
_symbolReference -> [11,0] -> dereferenced symbol string
"B0"
HISTORY
: CoC bn880 06/03/2003
DEPENDENCIES: CoC_LIBNUMSYS