October 17, 2007

Widening Conversion and Narrowing Conversion

What is Widening Conversion and Narrowing Conversion?
Allowable implicit conversion if the destination type can accommodate all possible value from the source type is called Widening Conversion. For Example -

Dim _i as Integer = 1
Dim _d as Double = 1.002
_d = _i

If the range or precision of the source type exceeds that of the destination type, the operation is called narrowing conversion, which usually requires explicit conversion.

Labels: , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home