core: all int is now num
This commit is contained in:
18
src/aton.🗿
Normal file
18
src/aton.🗿
Normal file
@ -0,0 +1,18 @@
|
||||
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;
|
||||
}
|
Reference in New Issue
Block a user