흠, 이전 코드를 검색해 보니 작동하는 것으로 나타났습니다!
function ItoA(value : Cardinal; Radix : Cardinal) : string;
const
acCharRef : array [0 .. 35] of char
= (
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
'W', 'X', 'Y', 'Z'
);
var
nIndex : Integer;
szBuild : string;
begin
{* Now loop, taking each digit as modulo radix, and reducing the value
* by dividing by radix, until the value is zeroed. Note that
* at least one loop occurs even if the value begins as 0,
* since we want "0" to be generated rather than "".
*}
szBuild := '';
repeat
nIndex := value mod radix;
szBuild := acCharRef[nIndex] + szBuild;
value := value div radix;
until value = 0;
result := szBuild;
end;
기수가 32 인 경우 "32"를 생성하는 올바른 입력이 10이되지 않습니까? (32의 삼중 루트는 pi보다 약간 비합리적 인 수치입니다.) –
@mason, yes - 문제가 해결되었습니다. – mj2008
링크 된 문서에서 utoa는 기본 10, 8, 16 만 지원합니다. 기본 32에 사용할 문자는 무엇입니까? – Jacob