Large numeric value is being rounded as a double

I have a web service that returns a large numeric value (ticks) to represent time.

The value is a number like this (I’ve added the formatting for readability): 635,645,909,367,259,480

When I assign that to a variable of type Double, it is reported as this: 635,645,909,367,260,000

So it is being rounded somehow. Is there another variable type that would not round this number?

Int64.

What happens if somebody is running a 32-bit iPhone 5?

Nothing special.

[quote=180226:@Jason Tait]
So it is being rounded somehow. Is there another variable type that would not round this number?[/quote]

See http://en.wikipedia.org/wiki/Double-precision_floating-point_format
Between 252=4,503,599,627,370,496 and 253=9,007,199,254,740,992 the representable numbers are exactly the integers. For the next range, from 253 to 254, everything is multiplied by 2, so the representable numbers are the even ones, etc. Conversely, for the previous range from 251 to 252, the spacing is 0.5, etc.

and perhaps UINT64 would work even better

Thank you for the explanation @Norman Palardy and for your suggestion @Dave S . I agree UNIT64 would be better.

So, just confirming, this will still work on a 32-bit device?

UINT64 is a datatype that is (or can be) independant of the OS…

iPhone4s is only 32bit, but UINT64 works there (I have SWIFT app that uses it)

Perfect, thanks.