PART II
C h a p t e r 2 1 :
E x p l o r i n g t h e S y s t e m N a m e s p a c e
627
public static bool IsPositiveInfinity(float
v
)
Returns true if
v
represents positive infinity. Other wise,
returns false.
public static bool IsNegativeInfinity(float
v
)
Returns true if
v
represents negative infinity.
Other wise, returns false.
public static float Parse(string
str
)
Returns the binar y equivalent of the numeric string in
str.
If the string does not represent a
float
value, an
exception is thrown.
public static float
Parse(string
str
,
IFormatProvider
fmtpvdr
)
Returns the binar y equivalent of the numeric string in
str
using the culture-specific information provided by
fmtpvdr.
If the string does not represent a
float
value,
an exception is thrown.
public static float
Parse(string
str
, NumberStyles
styles
)
Returns the binar y equivalent of the numeric string in
str
using the style information provided by
styles.
If the
string does not represent a
float
value, an exception is
thrown.
public static float
Parse(string
str
,
NumberStyles
styles
,
IFormatProvider
fmtpvdr
)
Returns the binar y equivalent of the numeric string in
str
using the style information provided by
styles
and
the culture-specific format information provided by
fmtpvdr.
If the string does not represent a
float
value,
an exception is thrown.
public override string ToString( )
Returns the string representation of the value of the
invoking object in the default format.
public string ToString(string
format
)
Returns the string representation of the value of
the invoking object as specified by the format string
passed in
format.
public string
ToString(IFormatProvider
fmtpvdr
)
Returns the string representation of the value of the
invoking object using the culture-specific information
specified in
fmtpvdr.
public string
ToString(string
format
,
IFormatProvider
fmtpvdr
)
Returns the string representation of the value of the
invoking object using the culture-specific information
specified in
fmtpvdr
and the format specified by
format.
public static bool Tr yParse(string
str
,
out float
val
)
Attempts to conver t the numeric string in
str
into a
float
value. If successful, the value is stored in
val
and
true is returned. If no conversion takes place, false is
returned. This differs from
Parse( )
, which throws an
exception on failure.
public static bool Tr yParse(string
str
,
NumberStyles
styles
,
IFormatProvider
fmtpvdr
,
out float
val
)
Attempts to conver t the numeric string in
str
into a
float
value using the style information provided by
styles
and the culture-specific format information
provided by
fmtpvdr.
If successful, the value is stored
in
val
and
true
is returned. If no conversion takes
place,
false
is returned. This differs from
Parse( )
,
which throws an exception on failure.
T
ABLE
21-3
Methods Suppor ted by
Single
(continued)
Method
Meaning
www.freepdf-books.com
628
P a r t I I :
E x p l o r i n g t h e C # L i b r a r y
Field
Meaning
public const float Epsilon
The smallest non-zero positive value.
public const float MaxValue
The largest value that a
float
can hold.
public const float MinValue
The smallest value that a
float
can hold.
public const float NaN
A value that is not a number.
public const float NegativeInfinity
A value representing negative infinity.
public const float PositiveInfinity
A value representing positive infinity.
T
ABLE
21-4
Fields Suppor ted by
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(double
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(double
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
Double
, which is
TypeCode.Double
.
public static bool IsInfinity(double
v
)
Returns true if
v
represents infinity (either
positive or negative). Other wise, returns false.
public static bool IsNaN(double
v
)
Returns true if
v
is not a number. Other wise,
returns false.
public static bool IsPositiveInfinity(double
v
)
Returns true if
v
represents positive infinity.
Other wise, returns false.
public static bool IsNegativeInfinity(double
v
)
Returns true if
v
represents negative infinity.
Other wise, returns false.
public static double Parse(string
str
)
Returns the binar y equivalent of the numeric
string in
str.
If the string does not represent a
double
value, an exception is thrown.
T
ABLE
21-5
Methods Suppor ted by
Double
www.freepdf-books.com
Do'stlaringiz bilan baham: |