#8401
tonne
Participant

Try
if (Math.abs(i) < Math.abs(n)) { //ascending