C# 0 The Complete Reference


PART I C h a p t e r   3



Download 4,07 Mb.
Pdf ko'rish
bet115/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   111   112   113   114   115   116   117   118   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt


PART I

C h a p t e r   3 :  

D a t a   T y p e s ,   L i t e r a l s ,   a n d   V a r i a b l e s  

59

PART IPART I



Type Conversion in Expressions

In addition to occurring within an assignment, type conversions also take place within an 

expression. In an expression, you can freely mix two or more different types of data as long 

as they are compatible with each other. For example, you can mix 



short

 and 


long

 within an 

expression because they are both numeric types. When different types of data are mixed 

within an expression, they are converted to the same type, on an operation-by-operation basis.

The conversions are accomplished through the use of C#’s 

type promotion rules.

 Here is 

the algorithm that they define for binary operations:

IF one operand is a 



decimal

, THEN the other operand is promoted to 




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   111   112   113   114   115   116   117   118   ...   1096




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish