2

Possible Duplicate:
What is the difference between Decimal, Float and Double in C#?

Today I'm wondering about Double in .Net. I've used it with Int32 the past days and started wondering what the max value is.

The MSDN page for Double.MaxValue says 1.7976931348623157E+308. I'm pretty sure I'm reading that wrong.

How many bytes does Double take up (in memory)?
What is the actual maximum number (explain the the E+308)?
Is Double.MaxValue bigger than UInt32? Bigger than UInt64?
And while we are at it, what is the difference between Float and Double?

Community
  • 1
  • 1
Tedd Hansen
  • 12,074
  • 14
  • 61
  • 97
  • In order to gain understanding on how the numbers are written, check here: http://en.wikipedia.org/wiki/Scientific_notation#E_notation – Fredrik Mörk Apr 19 '11 at 09:23
  • Thanks to everyone who made an effort to answer. To everyone who voted duplicate -- many SO users are shallow as usual. Please take the time to read the question fully before voting. :/ – Tedd Hansen Apr 19 '11 at 10:02

2 Answers2

0

Basically,

Double is 64 bit floating point value and float is a 32 bit. So double is able to store twice big value as of float.

http://msdn.microsoft.com/en-us/library/678hzkk9(v=vs.80).aspx http://msdn.microsoft.com/en-us/library/b1e65aza(v=vs.71).aspx

Just read the top lines on the links, you'll get an idea.

Tushar
  • 1,242
  • 1
  • 8
  • 19
0

About E+308: though 2^64 is far less that 1e+308, you must consider that double is not "precise" number, it has only a few significant digits (precision), so it does not need to store all ~308 digits. With this logic behind the double structure, it can contain numbers up to e+308 in 64 bits.

František Žiačik
  • 7,511
  • 1
  • 34
  • 59