Professional IronPython



Download 20,35 Mb.
Pdf ko'rish
bet110/453
Sana01.07.2022
Hajmi20,35 Mb.
#723045
1   ...   106   107   108   109   110   111   112   113   ...   453
88

CHAPTER 5
InteractIng wIth StructureS and ObjectS

__rxor__

__xor__


denominator


numerator


Floats, likewise, have a few methods that apply only to them. Most of these methods deal with 
performing comparisons. For example, you need a special method to determine that two floats are 
equal to each other (the 
__eq__()
method). The following list shows these methods:

__eq__

__ge__


__getformat__


__gt__


__le__


__lt__


__ne__


__setformat__


as_integer_ratio


fromhex


hex


is_integer


Performing Standard Tasks with Numbers
Now that you have a better idea of how numbers compare, it’s time to look at some specific methods. 
This section describes some of the more common methods used with numbers. You’ll see a good many 
of the other methods demonstrated as the book progresses.
➤➤
as_integer_ratio()
(float only): Displays a tuple showing the integer ratio used to produce 
the float. For example, if the float value is 5.5, then this method outputs (11L, 2L). To use 
this method type 
MyFloat.as_integer_ratio()
.


conjugate()
: Returns the conjugate of a complex number or the identity value of a real 
number. You can read more about conjugation at 
http://en.wikipedia.org/wiki/
Complex_conjugate
.


fromhex(str input)
 (float only): Outputs the decimal equivalent of a hexadecimal number 
input as a string. For example, to determine the decimal value of the hexadecimal number A5, 
you’d type 
MyFloat.fromhex(‘A5‘)
. In this case, the output is 165.



Download 20,35 Mb.

Do'stlaringiz bilan baham:
1   ...   106   107   108   109   110   111   112   113   ...   453




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