C++ question

Anything else. Post a funny site or tell us about yourself. Discuss current events or whatever else you want. Post off topic threads here.
Post Reply
User avatar
only_me
Active Member
Posts: 561
Joined: Sun Mar 02, 2008 6:38 pm
Quick Reply: Yes
Location: Off Topic

C++ question

Post by only_me »

what variable should i use if i want to memorize a big number? like a 30 digits one

unsigned long only memorize 10 digits..

later edit: meh i don't think such thing exist >_>
:(
COOL SIG

User avatar
[SD]Twysta
Senior Member
Posts: 4478
Joined: Wed Jan 17, 2007 11:59 am
Quick Reply: Yes
Location: Hollandia

Re: C++ question

Post by [SD]Twysta »

use long long. that's 19 digits.

paste me ur code i'll help you
Image
HejsaN wrote:
cpinney wrote:download more ram.

Where? Did not find any on google. :soosad:

User avatar
NuclearSilo
Forum God
Posts: 8834
Joined: Mon Aug 21, 2006 12:00 pm
Quick Reply: Yes
Location: Age of Wushu

Re: C++ question

Post by NuclearSilo »

oh come on, someone doesn't know how to google
it's in the 1st page http://msdn.microsoft.com/en-us/library ... tz(v=vs.80).aspx
Playing Age of Wushu, dota IMBA

User avatar
only_me
Active Member
Posts: 561
Joined: Sun Mar 02, 2008 6:38 pm
Quick Reply: Yes
Location: Off Topic

Re: C++ question

Post by only_me »

i need to do %666013 ( this is a prime number ) from a very big number.
that very big number i get it with this formula:
S=S*(v[i]+1)+S;

the vector has like 1'000'000 numbers .. so the number will be quite big.

i think i ll need to find a better method rather than doing all the calculus..


and for nuclearsilo, those are for microsoft visual c++.
it doesn't work for borland c++.. i mean that _int64 won't work :(
COOL SIG

User avatar
Stress
Ex-Staff
Posts: 4599
Joined: Thu Oct 26, 2006 7:42 am
Quick Reply: Yes
Location: Studying Computer Science, Vienna

Re: C++ question

Post by Stress »

There are many big integer libraries out there. Notably, I have used BigInt and GMP. The code in BigInt and GMP is designed to be cross-platform, so you shouldn't have problems deploying it in your programming environment.

EDIT:
Borland C++ sucks. Why would anyone still use that?
Carry your cross, and I'll carry mine.

User avatar
SM-Count
Ex-Staff
Posts: 2761
Joined: Sat Jan 12, 2008 7:02 pm
Quick Reply: Yes
Location: /wave

Re: C++ question

Post by SM-Count »

Just do all the calculations in mod (very big number). You will never exceed 6 digits.

User avatar
iGod
Veteran Member
Posts: 3728
Joined: Wed Oct 11, 2006 11:22 pm
Quick Reply: Yes
Location: Off Topic

Re: C++ question

Post by iGod »

Stress wrote:There are many big integer libraries out there. Notably, I have used BigInt and GMP. The code in BigInt and GMP is designed to be cross-platform, so you shouldn't have problems deploying it in your programming environment.

EDIT:
Borland C++ sucks. Why would anyone still use that?


We used to learn c++ on that in school, DOS mindset. :l

edit: shit, forgot to answer op... just off the top of my head, did you try "extended", or was that just for floating point operations? (I barely had a C in computer sciences class lol)

User avatar
apan
Active Member
Posts: 956
Joined: Mon Feb 09, 2009 11:58 pm
Quick Reply: Yes
Location: Pluto

Re: C++ question

Post by apan »

I've only used Python =/
LV 88 Nuker

LV 92 Blader

JuelzSantana wrote:technically speaking all i need is DOT for dull and wheel bind to kill a chinese char but the other stuff just adds salt to the wounds

im telling i never lose to chinese

edit: and if ur the type to throw up a fire wall or ice wall, i just walk away and sit down lol

Post Reply

Return to “Off Topic Lounge”