Sunday, 11 August 2013

Convert implicitly decimal to double or double to decimal

Convert implicitly decimal to double or double to decimal

Double Precision is: 15-16 digits.
Decimal Precision is: 28-29 significant digits.
so we can convert decimal to double implicitly.But consider this code:
double x = 100.3;
decimal y = 10.2;
x = y;
y = x;
x=y and y=x both of them has compile time error.
Why we can not convert decimal to double or double to decimal implicitly?

No comments:

Post a Comment