简体   繁体   中英

In Swift, what data type should I use to store Integers of 13 digits?

I don't know anything about 32 bit vs 64 bit (or what any of that means).

I just want to store an integer of 13 digits and use it like every other integer.

  • All my integers will be positive, never negative
  • Ideally no unnecessary typecasts (but it's okay if it's absolutely necessary)
  • I want the data type to be compatible with swift's sort functions
  • I'm developing for iOS8

What data type should I use?

Int64 or UInt64 . 999... decimal take 44 bits to store so both will be enough for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM