• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: 64 bit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 64 bit


  • Subject: Re: 64 bit
  • From: Alastair Houghton <email@hidden>
  • Date: Thu, 13 Dec 2007 12:33:48 +0000

On 13 Dec 2007, at 10:55, Perry Winkel wrote:

i need to multiply, divide, add and stuff on large (signed) integers
i was thinking about using 64 bit numbers
what is the strategy to follow within the Xcode/Darwin paradigm on
doing 64 bit integer math?


Use the "long long" type. Also, the long type becomes 64-bit on (and only on) 64-bit architectures.

tried that, but got an error telling me

"ISO c++ does not support long long"

seems like i have to enable/disbable some stuff but what?

I think you've got "treat warnings as errors" enabled, and you've also enabled
"pedantic warnings". You probably don't want pedantic warnings enabled; they
aren't really useful in most instances.


Also, if you know you want 64-bit numbers, I'd be inclined to use int64_t and/or
uint64_t (you'll have to #include <stdint.h> first) rather than long long. Or
maybe int_fast64_t since your goal here is performance and you only care about
having *at least* 64 bits.


Kind regards,

Alastair.

--
http://alastairs-place.net


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: 64 bit
      • From: "Sean McBride" <email@hidden>
References: 
 >64 bit (From: email@hidden)
 >Re: 64 bit (From: Nick Zitzmann <email@hidden>)
 >Re: 64 bit (From: Perry Winkel <email@hidden>)

  • Prev by Date: Problem with CFBundleGetFunctionPointerForName and 10.5 SDK
  • Next by Date: Why does linker give "ld: Undefined symbols:" error for symbols that appear to compile fine ?
  • Previous by thread: Re: 64 bit
  • Next by thread: Re: 64 bit
  • Index(es):
    • Date
    • Thread