Few basic c++ questions for x64

Discussion in 'Windows 64bit' started by D, Apr 19, 2006.

  1. D

    D Guest

    what is the range of the largest numeric data type available?

    If I do this (on xp32)

    __int64 g = 418235339844242000000;

    I get

    error C2177: constant too big

    Will compiling on xp64 solve this?

    I know Visual studio 2003 can compile for 64 when certain flags are set so I
    think if I set those flags I should be able to compile but just not be able
    to run it (unless I have xp64) . is that correct?


    Next, is stl available for 64 bit development? I use a map to store those
    large numbers.


    Thanks alot !!!!
     
    D, Apr 19, 2006
    #1
    1. Advertising

  2. D wrote:
    > what is the range of the largest numeric data type available?
    >
    > If I do this (on xp32)
    >
    > __int64 g = 418235339844242000000;
    >
    > I get
    >
    > error C2177: constant too big
    >
    > Will compiling on xp64 solve this?


    First of all the type is called int64_t, and you should not use __int64.
    But why do you think the type is any different between xp 32bit and xp
    64bit?

    Yours problem is that the number needs more than 64 bit to store, you
    you would need a 128 bit type. On some architectures (such as IA64), the
    compiler may prodive such a type, called int128_t. But I don't think
    AMD64 usually has it.

    Note that you also have to postfix your constant with LL. Some compilers
    do this for you, but that is not quite correct.

    > Next, is stl available for 64 bit development? I use a map to store those
    > large numbers.


    Sure, STL is part of the standard for years now.

    Thomas
     
    Thomas Steffen, Apr 20, 2006
    #2
    1. Advertising

  3. D

    D Guest

    "Thomas Steffen" <> wrote in message
    news:%...
    >D wrote:
    >> what is the range of the largest numeric data type available?
    >>
    >> If I do this (on xp32)
    >>
    >> __int64 g = 418235339844242000000;
    >>
    >> I get
    >>
    >> error C2177: constant too big
    >>
    >> Will compiling on xp64 solve this?

    >
    > First of all the type is called int64_t, and you should not use __int64.
    > But why do you think the type is any different between xp 32bit and xp
    > 64bit?


    ok I apologize that I wasn't clear. I was trying to determine the largest
    data type (and range) available on 64 bit machines. I wasn't aware of int128
    but that or long long will suffice. Thanks


    >
    > Yours problem is that the number needs more than 64 bit to store, you you
    > would need a 128 bit type. On some architectures (such as IA64), the
    > compiler may prodive such a type, called int128_t. But I don't think AMD64
    > usually has it.
    >
    > Note that you also have to postfix your constant with LL. Some compilers
    > do this for you, but that is not quite correct.
    >
    >> Next, is stl available for 64 bit development? I use a map to store those
    >> large numbers.

    >
    > Sure, STL is part of the standard for years now.
    >
    > Thomas
     
    D, Apr 20, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jaime
    Replies:
    2
    Views:
    557
    Jaime
    Sep 20, 2003
  2. Dotnet_Is_Love

    Few Basic questions about exam 316

    Dotnet_Is_Love, Dec 1, 2003, in forum: MCSD
    Replies:
    1
    Views:
    422
    latha
    Dec 3, 2003
  3. D
    Replies:
    4
    Views:
    609
    Mark Gillespie
    Apr 21, 2006
  4. Giuen
    Replies:
    0
    Views:
    979
    Giuen
    Sep 12, 2008
  5. Cody
    Replies:
    2
    Views:
    3,546
    John Wunderlich
    Jun 28, 2009
Loading...

Share This Page