I need to store some very big positive floating values in my C++
program. For example, 50e+15. Which number type I should use? Is
"double" big enough?
double will always be big enough to hold 50e+15 (which isn't all that
big). Querying your implementation for its limits tells you what its
limits are, but doesn't tell you what you can rely on from other
compilers. The language definition does that, and it says that double
must support exponents ranging from -37 to 37, inclusive, and that it
must support at least 10 decimal digits. (That's spelled out in sections
12.2.2 and 12.2.3 of my book) Despite the advice you've been given, you
shouldn't design new data types until you've determined that the builtin
ones won't do what you need. From what you've described so far, that's
not the case.
--
-- Pete
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." For more information about this book, see
www.petebecker.com/tr1book.