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. Advertisements

  2. 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

    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.
    Sure, STL is part of the standard for years now.

    Thomas Steffen, Apr 20, 2006
    1. Advertisements

  3. D

    D Guest

    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
    D, Apr 20, 2006
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.