Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > Windows 64bit > Few basic c++ questions for x64

Reply
Thread Tools

Few basic c++ questions for x64

 
 
D
Guest
Posts: n/a
 
      04-19-2006
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 !!!!





 
Reply With Quote
 
 
 
 
Thomas Steffen
Guest
Posts: n/a
 
      04-20-2006
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
 
Reply With Quote
 
 
 
 
D
Guest
Posts: n/a
 
      04-20-2006

"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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet connects for a few seconds then disconnects for a few sec Cody Wireless Networking 2 06-28-2009 08:24 PM
Few Questions (HW questions already answered by me) padh.ayo@gmail.com C Programming 10 12-06-2006 05:48 PM
Few basic c++ questions regarding 64 bit programming D Windows 64bit 4 04-21-2006 05:02 PM
To delete few lines and add few lines at the end of a text file using c program Murali C++ 2 03-09-2006 04:45 PM
Few Basic questions about exam 316 Dotnet_Is_Love MCSD 1 12-03-2003 09:31 PM



Advertisments