pow() has been replaced by the exponentiation operator (x ** y),
see here:
In your case you would need to do these changes:
// change this
set .@num$, .@num % pow(10,.@i+1) / pow(10,.@i) + .@num$;
// to this:
.@num$ = .@num % (10 ** (.@i + 1)) / (10 ** .@i) + .@num$;