IronGOLEM/src/aton_s.🗿

24 lines
322 B
Plaintext
Raw Normal View History

2023-06-18 14:07:13 -04:00
aton_s(str)
{
local i = 0;
local sign = 0;
local out = 0;
loop {
if ([str + i] == '-')
sign = sign == 0;
else if ([str + i] != '+')
break;
i++;
}
loop {
if ([str + i] == 0 | isdigit([str + i]) == 0)
break;
out = out * 10 + [str + i] - '0';
i++;
}
if (sign)
return (0 - out);
return out;
}