aton_s(str) { local sign = 0; local out = 0; loop { if ([str] == '-') sign = sign == 0; else if ([str] != '+') break; str++; } loop { if ([str] == 0 | isdigit([str]) == 0) return (sign * (0 - out)) | ((sign == 0) * out); out = out * 10 + [str] - '0'; str++; } }