how to save a long long int (64 bit) in simply an int ?
i.e and int inputs values tht are very long and save them and then we have to multiply those values from one another.
we cannot use long from it , i.e we have to combine two 32 bit int to make a 64 bit .
we can use classes.
6 replies to this topic
#1
Posted 15 July 2010 - 01:01 AM
|
|
|
#2
Posted 15 July 2010 - 01:23 AM
So, you aren't allowed to use "long long", right? You could use a struct instead that consists of two 32-bit integers.
Simply ask if there are more questions.
Greets,
artificial
struct MyInt64
{
long nHighOrderQW; //QW = Quadword = 32 bit
long nLowOrderQW;
};
Simply ask if there are more questions.
Greets,
artificial
Edited by artificial, 15 July 2010 - 02:38 AM.
Sometimes words ain't enough to express something. That's why computer scientists use double words.
#3
Posted 15 July 2010 - 03:03 AM
what further ?
how will we carry on with the program , please help me it it!!
how will we carry on with the program , please help me it it!!
#4
Posted 15 July 2010 - 04:40 AM
Same question posted on DaniWeb.
Visit Grandpa's Forums, a social networking forum, with family-oriented arcade games, blogs, discussion forums, and photo albums.
#5
Posted 15 July 2010 - 06:23 AM
artificial said:
So, you aren't allowed to use "long long", right? You could use a struct instead that consists of two 32-bit integers.
Simply ask if there are more questions.
Greets,
artificial
struct MyInt64
{
long nHighOrderQW; //QW = Quadword = 32 bit
long nLowOrderQW;
};
Simply ask if there are more questions.
Greets,
artificial
#6
Posted 15 July 2010 - 11:28 AM
This appears to be a homework question.
@Op: I'd advise you to look into arbitrary precision arithmetic. In particular, look at the theory and a very good example on LiteratePrograms.
@Op: I'd advise you to look into arbitrary precision arithmetic. In particular, look at the theory and a very good example on LiteratePrograms.
#7
Posted 15 July 2010 - 11:44 AM
zoranh said:
Lower part must be unsigned long or won't work.
Oh, yes, you're right. My bad. :)
Sometimes words ain't enough to express something. That's why computer scientists use double words.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









