18,446,744,073,709,551,615 limit in c++

18,446,744,073,709,551,615 limit in c++

Post by agent509 on Fri Nov 07, 2008 12:57 pm
([msg=14615]see 18,446,744,073,709,551,615 limit in c++[/msg])

i cant print numbers larger than 18,446,744,073,709,551,615 on the screen. does anybody know how i can fix this?
agent509
New User
New User
 
Posts: 13
Joined: Thu Jun 26, 2008 2:12 pm
Blog: View Blog (0)


Re: 18,446,744,073,709,551,615 limit in c++

Post by myhexhax on Fri Nov 07, 2008 1:08 pm
([msg=14616]see Re: 18,446,744,073,709,551,615 limit in c++[/msg])

Are you storing that in an unsigned long? You may want to switch datatypes, perhaps to float/double. That number is the limit of a 64bit unsigned number storage data type, so you have to use something 'bigger' (imprecise types like double, float, etc are your best bet I guess) 0xffffffffffffffff is huge though, what are you doing? lol. But basically, you are reaching architecture and language limitations.
gniripsni ewa si rehte eht morf cisum siht
myhexhax
Poster
Poster
 
Posts: 217
Joined: Tue Sep 16, 2008 2:19 pm
Location: Between the ether and the information superhighway
Blog: View Blog (0)


Re: 18,446,744,073,709,551,615 limit in c++

Post by agent509 on Fri Nov 07, 2008 1:48 pm
([msg=14617]see Re: 18,446,744,073,709,551,615 limit in c++[/msg])

no. i need something that will put the numbers on the screen. not in scientific form. and even in scientific form the number was too big. i'm trying to see how long it would take to print in long form 10^(10^100) or 10^googol or googolplex
agent509
New User
New User
 
Posts: 13
Joined: Thu Jun 26, 2008 2:12 pm
Blog: View Blog (0)


Re: 18,446,744,073,709,551,615 limit in c++

Post by Dr_Phil on Sun Nov 09, 2008 11:03 am
([msg=14707]see Re: 18,446,744,073,709,551,615 limit in c++[/msg])

EDIT: Nothing.. :oops:
Dr_Phil
Poster
Poster
 
Posts: 171
Joined: Mon Sep 01, 2008 12:36 pm
Blog: View Blog (0)


Re: 18,446,744,073,709,551,615 limit in c++

Post by L0DER on Wed Nov 12, 2008 2:32 am
([msg=14847]see Re: 18,446,744,073,709,551,615 limit in c++[/msg])

Ok if you need to deal with so large number, you have to develop unit system:
You should divide every number into groups: units, tens, hundred, thousands etc.
You have to create function that maneges the division to units.
And then you have to modify all the operators.
Good Luck.
L0DER
New User
New User
 
Posts: 26
Joined: Tue Apr 22, 2008 12:58 am
Blog: View Blog (0)


Re: 18,446,744,073,709,551,615 limit in c++

Post by Liquid_Obsidian on Wed Nov 12, 2008 4:44 am
([msg=14849]see Re: 18,446,744,073,709,551,615 limit in c++[/msg])

Liquid_Obsidian
New User
New User
 
Posts: 8
Joined: Sun Oct 12, 2008 12:50 pm
Blog: View Blog (0)



Return to C and C++

Who is online

Users browsing this forum: No registered users and 0 guests

cron