forked from starnakin/IronGOLEM
19 lines
222 B
Plaintext
19 lines
222 B
Plaintext
aton(str)
|
|
{
|
|
local i = 0;
|
|
local out = 0;
|
|
|
|
loop {
|
|
if ([str + i] != '+')
|
|
break;
|
|
i++;
|
|
}
|
|
loop {
|
|
if ([str + i] == 0 | isdigit([str + i]) == 0)
|
|
break;
|
|
out = out * 10 + [str + i] - '0';
|
|
i++;
|
|
}
|
|
return out;
|
|
}
|