C# 0 The Complete Reference


The Floating-Point Structures



Download 4,07 Mb.
Pdf ko'rish
bet786/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   782   783   784   785   786   787   788   789   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

The Floating-Point Structures

There are two floating-point structures: 



Double

 and 


Single

.

Single

 represents 

float

. Its 


methods are shown in Table 21-3, and its fields are shown in Table 21-4. 

Double

 represents 



double

. Its methods are shown in Table 21-5, and its fields are shown in Table 21-6. As is the 

case with the integer structures, you can specify culture-specific information and format 

information in a call to 



Parse( )

 or 


ToString( )

.

The floating-point structures implement the following interfaces: 



IComparable

,

IComparable

,

IConvertible

,

IFormattable

, and 

IEquatable

, where 


T

 is replaced 

by either 

double

 for 


Double

 or 


float

 for 


Single

.

Method



Meaning

public int CompareTo(object 



v

)

Compares the numerical value of the invoking object 



with that of 

v.

 Returns zero if the values are equal. 

Returns a negative value if the invoking object has a 

lower value. Returns a positive value if the invoking 

object has a greater value.

public int CompareTo(float 



v

)

Compares the numerical value of the invoking object 



with that of 

v.

 Returns zero if the values are equal. 

Returns a negative value if the invoking object has a 

lower value. Returns a positive value if the invoking 

object has a greater value. 

public override bool Equals(object 



v

)

Returns true if the value of the invoking object equals 



the value of 

v.

public bool Equals(float 



v

)

Returns true if the value of the invoking object equals 



the value of 

v.

public override int GetHashCode( )

Returns the hash code for the invoking object.

public TypeCode GetTypeCode( )

Returns the 

TypeCode


 enumeration value for 

Single


,

which is 

TypeCode.Single

.

public static bool IsInfinity(float 



v

)

Returns true if 



v

 represents infinity (either positive or 

negative). Other wise, returns false.

public static bool IsNaN(float 



v

)

Returns true if 



v

 is not a number. Otherwise, returns false.

T

ABLE


 21-3 

Methods Suppor ted by 

Single

www.freepdf-books.com




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   782   783   784   785   786   787   788   789   ...   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