C# Floating Point Variable Types

Part of the C# 2010 All-In-One For Dummies Cheat Sheet

C# floating point variables come in two types: float and double. The following table compares these two types in terms of size, range, and accuracy.

Type Size (bytes) Range Accuracy In Use
float 8 1.5 x 10–45 to 3.4 x 1038 6–7 digits float f = 1.2F;
double 16 5.0 x 10–324 to 1.7 x 10308 15–16 digits double d = 1.2;
  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus

SERIES
C# 2010 All-In-One For Dummies Cheat Sheet

Advertisement

Inside Dummies.com

Dummies.com Sweepstakes

Win $500. Easy.