Aye...the F is a type suffix which helps the compiler know which type you
are talking about when it can't necessarily tell.
F or f is float
D or d is double (the default)
M or m is decimal
that's for real numbers....integer values also have them for like U/u L/l
and combination of those (unsigned int, long, unsigned long ...)
There are probably more. VB.Net also makes use of them , such as with "a"c
to represent a character (notice the c after the string literal)....since
single quotes aren't available...
These can be important, especially in performaing math with literal numeric
values. For example:
double d = 1.2345678
double dx = d + (1d / 1200d) //1.2354011333333333333333333333333
double dy = d + (1 / 1200) //1.2345678
You will get 2 diffferent results from these 2 apparently identical
operations. This is due to the way the parenthetical numeric expression is
treated by the CLR.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.