Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTucker Kunkle
256 Pointsis a float variable the same as a double variable
when I was watching the c# video on variable types, I didn't see the float variable. in its place (or I thought was its place) was the double variable.... doesn't the float variable have the double value? example: float number = 5.564;
1 Answer
Jennifer Nordell
Treehouse TeacherHi there, Tucker Kunkle! There is a data type in C# named float
as well as double
and decimal
. All are "floating point types." The difference between them really is the minimum and maximum size. A float
is the smallest, double
is the middle size, and decimal
is the largest. I would say that double
is probably used most often just because it is the mid-range size.
Here's some documentation on floating point types in C#
Hope this helps!
Tucker Kunkle
256 PointsTucker Kunkle
256 Pointsthank you! this answered my question perfectly!