1

I was reading twitter when I came across a tweet that said..

parseInt(1/0,19); //18

Of course, in JS, anything divided by 0 is Infinity, but what does the radix 19 mean, and why is Infinity radix 19 parsed to 18?

Other radix, such as 16, or 10 (default) will yield "NaN", so what's special about the radix 19?

Sterling Archer
  • 22,070
  • 18
  • 81
  • 118

1 Answers1

1

Upper-case letters are used in bases above 10, and I is the ninth letter of the alphabet. Thus, it's one less than 19.

Pointy
  • 405,095
  • 59
  • 585
  • 614