34,333
edits
Changes
→C# Integer Variable Types
<tr>
<td>long<td>8 bytes<td>0 to 2 x 10<sup>20</sup></td>
</table>
== C# Floating Point Variables ==
Integers are fine for dealing with whole numbers but of little use when there are numbers after the decimal point. Such numbers may be stored in ''float'' or ''double'' variable types. The default type for such numbers is ''double''. The following table shows the two types with comparisons of the number ranges supported and the number of ''significant digits'' in each case:
<table border="1" cellspacing="0">
<tr style="background:#efefef;">
<th>Type</th><th>Size in Bytes</th><th>Value Range</th><th>Digit Accuracy</th>
<tr>
<td>float<td>8 bytes<td>1.5 * 10<sup>-45</sup> to 3.4 * 10<sup>38</sup><td> 6 - 7 digits</td>
<tr>
<td>double<td>16 bytes<td>5.0 * 10<sup>-324</sup> to 1.7 * 10<sup>308</sup><td>15 - 16 digits</td>
</table>