By Daniel · March 21, 2009
Parse a numeric string in some specified base and the quantity as an integer
// parseInt(n, radix)
var n, r, m, s;
n = abs(real(argument0));
r = argument1;
m = 1; s = 0;
while (n) {
s += n mod 10 * m;
m *= r; n = n div 10;
}
return sign(real(argument0)) * s;
Categories: Data processing, Mathematics