I should have updated this on the day I had this lecture but anyway today I learnt what the difference is between Floats and Double and Decimal, Float holds up to 6 decimal points, double up to 14 and decimal up to 28.
Also Learnt that in C# you need to specify the datatype for a number otherwise either int (for whole numbers) of double (for decimal) is assumed.
Also Learnt that in C# you need to specify the datatype for a number otherwise either int (for whole numbers) of double (for decimal) is assumed.
- 2.0M - M suffix Specifies Decimal Datatype
- 2.0 - adding '.0' specifies double datatype, can also use d
- 2 - specifies int by default
Was this helpful?
Comments
Post a Comment