def b10_convertFrom(anum10, aradix, *args):
    """
        ARGS
        anum10            in      number in base 10
        aradix            in      convert <anum10> to number in base
                                  + <aradix>

        OPTIONAL
        forcelength       in      if nonzero, indicates the length
                                  + of the return array. Useful if
                                  + array needs to be zero padded.

        DESC
        Converts a scalar from base 10 to base radix. Return
        an array.

        NOTE:
        "Translated" from a MatLAB script of the same name.
    """
    i = 0;
    k = 0;

    # Cycle up in powers of radix until the largest exponent is found.
    # This is required to determine the word length
    while (pow(aradix, i)) <= anum10:
        i = i + 1;
    forcelength = i

    # Optionally, allow user to specify word length
    if len(args): forcelength = args[0]

    # Check that word length is valid
    if(forcelength and (forcelength < i)):
        error_exit('b10_convertFrom',
                   'checking on requested return array',
                   'specified length is too small',
                   1)

    numm = anum10;
    num_r = zeros((forcelength));
    if(i):
        k = forcelength - i;
    else:
        k = forcelength - 1;

    if(anum10 == 1):
        num_r[(k)] = 1;
        return num_r;

    for j in arange(i, 0, -1):
        num_r[(k)] = fix(numm / pow(aradix, (j - 1)));
        numm = numm % pow(aradix, (j - 1));
        k = k + 1;
    return num_r