In Javascript, floating point numbers are stored as double precision values. These have about 16 significant digits, which means that a 17-digit number won't necessarily be stored exactly.
You can supply numbers of any length to parseFloat()
, but it won't be possible to store anything larger than 1.79769×10308, which is the largest possible value that can be stored in a double precision variable.
I'd recommend reading this if you have time: What Every Computer Scientist Should Know About Floating-Point Arithmetic