-1

When I work with big numbers Sublime Text 2 or Node.js (I don't know which one it actually does) shortens those big numers. For example:

var example = Math.pow(2, 70);

example = 1.1805916207174113e+21

I would like to see the full number (1180591620717411303424), but I don't know which settings I have to change for that nor do I know where to find those settings.

Krandalf
  • 48
  • 1
  • 6

1 Answers1

1

It's NodeJS that's "shortenting" these numbers. It display large numbers in scientific notation, because Javascript uses 64-bit floating point numbers.

If you're referring to displaying numbers not in scientific notation, i.e. 'x.xxxxxxxxxxe+yy', refer to this SO answer:

How to avoid scientific notation for large numbers in JavaScript?

If you're looking to handle numbers larger than 64-bit floats...

JavaScript can't handle 64-bit integers, can it?

And note the mention of the library "BigNumber".

Community
  • 1
  • 1
Lucas Watson
  • 763
  • 1
  • 8
  • 26