hello. Ive been using a pretty long number in my program . its problem3 of the euler project . Its 600851475143 . What data type do I use for this???
nagu89
0
Newbie Poster
Recommended Answers
Jump to Posta "long long" data type is a 64 bit number, and gives
Signed min: -9223372036854775808
Signed max: 9223372036854775807
Unsigned max: 18446744073709551615
.
Jump to Postthe format specifier for a long long int is
long long myBigNum=600851475143; printf("the number is: %lld\n",myBigNum);
.
Jump to Post[IMG]http://img8.imageshack.us/my.php?image=devsnap.png[/IMG]
Im still not able to get the precision requiredi dont know why not.
i'm using GCC v3.4, which is over 3 years old.
#include <stdio.h> #include <stdlib.h> …
All 23 Replies
jephthah
1,888
Posting Maven
jephthah
1,888
Posting Maven
Dave Sinkula
2,398
long time no c
Team Colleague
jephthah
commented:
i think i suffer from hoof and mouth disease.
+10
nagu89
0
Newbie Poster
jephthah
1,888
Posting Maven
nagu89
0
Newbie Poster
nagu89
0
Newbie Poster
s_sridhar
7
Junior Poster
jephthah
commented:
ridiculous
-2
jephthah
1,888
Posting Maven
s_sridhar
7
Junior Poster
s_sridhar
7
Junior Poster
jephthah
1,888
Posting Maven
s_sridhar
7
Junior Poster
nagu89
0
Newbie Poster
s_sridhar
7
Junior Poster
nagu89
0
Newbie Poster
s_sridhar
7
Junior Poster
jephthah
commented:
wrong
-2
nagu89
0
Newbie Poster
jephthah
1,888
Posting Maven
s_sridhar
7
Junior Poster
Ancient Dragon
commented:
This is a C forum, not c++.
-7
s_sridhar
7
Junior Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.