Professional IronPython



Download 20,35 Mb.
Pdf ko'rish
bet111/453
Sana01.07.2022
Hajmi20,35 Mb.
#723045
1   ...   107   108   109   110   111   112   113   114   ...   453
hex()
 (float) or 
__hex__()
 (integer): Outputs the hexadecimal value of the float or integer. 
For example, to find the hexadecimal value of 
MyInt
, you’d type 
MyInt.__hex__()
.
548592c05.indd 88
2/24/10 1:21:48 PM
www.finebook.ir


Creating New Objects
 

 
89


imag
: Contains the imaginary part of a complex number. To use this attribute you’d type 
MyComplex.imag
.


is_integer()
 (float only): Determines whether the content of a floating point number is an 
integer in value. When using this method, a value of 5.0 would return 
True
, while a value of 
5.1 would return 
False
. To use this method, you’d type 
MyFloat.is_integer()
.


real
: Contains the real part of a complex number. To use this attribute you’d type 
MyComplex.real
.
The 
int.denominator
 and 
int.numerator
 attributes are in place for
support of rational numbers. You can read more about this support at
http://www.python.org/dev/peps/pep-0239/
.
Working with boolean objects
Boolean objects provide access to truth values about other objects and their relationships. Many 
objects have Boolean methods built in. For example, when working with a float, you can use the 
equality methods 
__eq__()

__ge__()

__gt__()

__le__()

__lt__()
, and 
__ne__()
to deter-
mine relationships between values. In fact, Boolean objects also include these equality methods and 
you might find them useful at times for comparing the truth value of two Boolean objects.
For the most part, Boolean objects have little in the way of other methods that you need when
creating a typical IronPython application. For example, you could use the 
__long__()
method to 
convert the Boolean to long integer, but that really wouldn’t accomplish much for most developers. 
About the only other method that you really need to know about is 
__format__()
, which is 
explained in the “Formatting String Output” section of the chapter.

Download 20,35 Mb.

Do'stlaringiz bilan baham:
1   ...   107   108   109   110   111   112   113   114   ...   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