>
What exactly is JavaScript's numeric type then? I always presumed it was a 32-bit, signed integer.It's not ideal to presume such a thing when there are ways to find out the answer, either from the link in a sibling comment or by observing JavaScript code that uses the Google Maps API or similar mapping APIs. How would you represent a latitude or longitude with a 32-bit integer?
I don't mean to pick on you. I have made these same kinds of assumptions too many times and it always got me in trouble.
Here's a particularly embarrassing example. When I did my first election results map for Google, I needed a way to represent the outline of a state. I saw that the Maps API supported polygons, so I thought "that's great, I can use a polygon for each state!"
Until the map went live and someone asked me "What happened to the northern part of Michigan [which isn't connected to the rest of the state]? And where are the rest of the Hawaiian Islands?"
It turned out that a single polygon wasn't enough to represent the outline of a state. Who would have guessed?
Don't let this happen to you. :-)