This print for content only-size & color not accurate 7" X 9-1/4" / casebound / malloy


// sum should hold the value 350. However, we find the value 94!



Download 21,46 Mb.
Pdf ko'rish
bet222/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   218   219   220   221   222   223   224   225   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition

// sum should hold the value 350. However, we find the value 94!

Console.WriteLine("sum = {0}", sum);

}

If you were to view the output of this application, you might be surprised to find that sum con-



tains the value 94 (rather than the expected 350). The reason is simple. Given that a System.Byte can

hold a value only between 0 and 255 (inclusive, for a grand total of 256 slots), sum now contains the

overflow value (350 – 256 = 94). By default, if you take no corrective course of action, overflow/under-

flow conditions occur without error.

To handle overflow or underflow conditions in your application, you have two options. Your

first choice is to leverage your wits and programming skills to handle all overflow/underflow condi-

tions manually. Assuming you were indeed able to find each overflow condition in your program,

you could resolve the previous overflow error as follows:




Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   218   219   220   221   222   223   224   225   ...   1830




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