Hi there,

I'm a novice (very novice) programming student. Can you tell me what the maximum and minimum values for doubles are. Or if you cannot tell what they are, can you teach me method to figuring this out. Thank you.

Printable View

- 10-22-2002noor_mirzaFloating point numbers
Hi there,

I'm a novice (very novice) programming student. Can you tell me what the maximum and minimum values for doubles are. Or if you cannot tell what they are, can you teach me method to figuring this out. Thank you. - 10-22-2002MrWizardRe: Floating point numbersQuote:

*Originally posted by noor_mirza*

**Hi there,**

I'm a novice (very novice) programming student. Can you tell me what the maximum and minimum values for doubles are. Or if you cannot tell what they are, can you teach me method to figuring this out. Thank you.

-128 to 127 ( signed )

0 to 255 ( unsigned )

So you could probably do it on your own to figure out what double is relatively easily. If you need more help or want to check your answer, let me know. Good luck. - 10-23-2002SilentStrike
The max value for a double is much more complex than for integral types (short, char, int, long) because it is likely the IEEE 7somethingsomething standard, and involves two different kinds of numbers, one sequence is for the power of the number, and the other is for base.

The numeric limits of all types are actually stored in an easy to use template. This will output the maximum value of a double on a standard compiler.

Code:`#include <iostream>`

#include <limits>

int main() {

std::cout << std::numeric_limits<double>::max() << std::endl;

return 0;

}

- 10-23-2002ripper079
Well if you want to cheat a little you can always open

**limits.h**or**float.h**. There you can check for the maximum and minimum value for both intregral and floating-point numbers.