decimal
(unless it is of type
fl oat
or
double
, in which case an error results).
ELSE IF one operand is a
double
, the second is promoted to
double
.
ELSE IF one operand is a
fl oat
, the second is promoted to
fl oat
.
ELSE IF one operand is a
ulong
, the second is promoted to
ulong
(unless it is
of type
sbyte
,
short
,
int
, or
long
, in which case an error results).
ELSE IF one operand is a
long
, the second is promoted to
long
.
ELSE IF one operand is a
uint
and the second is of type
sbyte
,
short
, or
int
,
both are promoted to
long
.
ELSE IF one operand is a
uint
, the second is promoted to
uint
.
ELSE both operands are promoted to
int
.
There are a couple of important points to be made about the type promotion rules. First,
not all types can be mixed in an expression. Specifically, there is no implicit conversion from
Do'stlaringiz bilan baham: |