Is there a data type that can allow a user to input a 25 digit number... because the largest data type for numbers that i know is long long int and uintmax_t which can only store 18 numbers (i'm not sure about this)... because my problem should allow a user to input 25 numbers... If a larger data type is impossible, is there another way??? (I'm a beginner to c++ and i'm really sorry if this question sounds stupid) :)
johnas.delacruz 0 Newbie Poster
Recommended Answers
Jump to PostA 64bit integer is the largest native type currently in C++. However you are not the first person to have this problem and the way round it is to use a big integer classes. Classes of this nature can normally hold any number of digits which they do by using …
Jump to PostUsing a BigInt library is one solution.
Also, what are those digits?
If this is just a very big number, then you might just use a floating-point type instead (
float
ordouble
) which don't really have an upper-limit (well, they do, but it's like 1e308), and instead, have a limited-precision …
All 5 Replies
Banfa 597 Posting Pro Featured Poster
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
panqnik 0 Newbie Poster
David W 131 Practically a Posting Shark
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.