mscorlib(4.0.0.0) API with additions
|
Represents a single-precision floating-point number. More...
Public Member Functions | |
int | CompareTo (object value) |
Compares this instance to a specified object and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified object. More... | |
int | CompareTo (float value) |
Compares this instance to a specified single-precision floating-point number and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified single-precision floating-point number. More... | |
override bool | Equals (object obj) |
Returns a value indicating whether this instance is equal to a specified object. More... | |
bool | Equals (float obj) |
Returns a value indicating whether this instance and a specified T:System.Single object represent the same value. More... | |
unsafe override int | GetHashCode () |
Returns the hash code for this instance. More... | |
override string | ToString () |
Converts the numeric value of this instance to its equivalent string representation. More... | |
string | ToString (IFormatProvider provider) |
Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information. More... | |
string | ToString (string format) |
Converts the numeric value of this instance to its equivalent string representation, using the specified format. More... | |
string | ToString (string format, IFormatProvider provider) |
Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information. More... | |
TypeCode | GetTypeCode () |
Returns the T:System.TypeCode for value type T:System.Single. More... | |
bool IConvertible. | ToBoolean (IFormatProvider provider) |
For a description of this member, see M:System.IConvertible.ToBoolean(System.IFormatProvider). More... | |
char IConvertible. | ToChar (IFormatProvider provider) |
This conversion is not supported. Attempting to use this method throws an T:System.InvalidCastException. More... | |
sbyte IConvertible. | ToSByte (IFormatProvider provider) |
For a description of this member, see M:System.IConvertible.ToSByte(System.IFormatProvider). More... | |
byte IConvertible. | ToByte (IFormatProvider provider) |
For a description of this member, see M:System.IConvertible.ToByte(System.IFormatProvider). More... | |
short IConvertible. | ToInt16 (IFormatProvider provider) |
For a description of this member, see M:System.IConvertible.ToInt16(System.IFormatProvider). More... | |
ushort IConvertible. | ToUInt16 (IFormatProvider provider) |
For a description of this member, see M:System.IConvertible.ToUInt16(System.IFormatProvider). More... | |
int IConvertible. | ToInt32 (IFormatProvider provider) |
For a description of this member, see M:System.IConvertible.ToInt32(System.IFormatProvider). More... | |
uint IConvertible. | ToUInt32 (IFormatProvider provider) |
For a description of this member, see M:System.IConvertible.ToUInt32(System.IFormatProvider). More... | |
long IConvertible. | ToInt64 (IFormatProvider provider) |
For a description of this member, see M:System.IConvertible.ToInt64(System.IFormatProvider). More... | |
ulong IConvertible. | ToUInt64 (IFormatProvider provider) |
For a description of this member, see M:System.IConvertible.ToUInt64(System.IFormatProvider). More... | |
float IConvertible. | ToSingle (IFormatProvider provider) |
For a description of this member, see M:System.IConvertible.ToSingle(System.IFormatProvider). More... | |
double IConvertible. | ToDouble (IFormatProvider provider) |
For a description of this member, see M:System.IConvertible.ToDouble(System.IFormatProvider). More... | |
decimal IConvertible. | ToDecimal (IFormatProvider provider) |
For a description of this member, see M:System.IConvertible.ToDecimal(System.IFormatProvider). More... | |
DateTime IConvertible. | ToDateTime (IFormatProvider provider) |
This conversion is not supported. Attempting to use this method throws an T:System.InvalidCastException. More... | |
object IConvertible. | ToType (Type type, IFormatProvider provider) |
For a description of this member, see M:System.IConvertible.ToType(System.Type,System.IFormatProvider). More... | |
![]() | |
bool | Equals (T other) |
Indicates whether the current object is equal to another object of the same type. More... | |
Static Public Member Functions | |
static unsafe bool | IsInfinity (float f) |
Returns a value indicating whether the specified number evaluates to negative or positive infinity. More... | |
static unsafe bool | IsPositiveInfinity (float f) |
Returns a value indicating whether the specified number evaluates to positive infinity. More... | |
static unsafe bool | IsNegativeInfinity (float f) |
Returns a value indicating whether the specified number evaluates to negative infinity. More... | |
static unsafe bool | IsNaN (float f) |
Returns a value that indicates whether the specified value is not a number (F:System.Single.NaN). More... | |
static bool | operator== (float left, float right) |
Returns a value that indicates whether two specified T:System.Single values are equal. More... | |
static bool | operator != (float left, float right) |
Returns a value that indicates whether two specified T:System.Single values are not equal. More... | |
static bool | operator< (float left, float right) |
Returns a value that indicates whether a specified T:System.Single value is less than another specified T:System.Single value. More... | |
static bool | operator > (float left, float right) |
Returns a value that indicates whether a specified T:System.Single value is greater than another specified T:System.Single value. More... | |
static bool | operator<= (float left, float right) |
Returns a value that indicates whether a specified T:System.Single value is less than or equal to another specified T:System.Single value. More... | |
static bool | operator >= (float left, float right) |
Returns a value that indicates whether a specified T:System.Single value is greater than or equal to another specified T:System.Single value. More... | |
static float | Parse (string s) |
Converts the string representation of a number to its single-precision floating-point number equivalent. More... | |
static float | Parse (string s, NumberStyles style) |
Converts the string representation of a number in a specified style to its single-precision floating-point number equivalent. More... | |
static float | Parse (string s, IFormatProvider provider) |
Converts the string representation of a number in a specified culture-specific format to its single-precision floating-point number equivalent. More... | |
static float | Parse (string s, NumberStyles style, IFormatProvider provider) |
Converts the string representation of a number in a specified style and culture-specific format to its single-precision floating-point number equivalent. More... | |
static bool | TryParse (string s, out float result) |
Converts the string representation of a number to its single-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed. More... | |
static bool | TryParse (string s, NumberStyles style, IFormatProvider provider, out float result) |
Converts the string representation of a number in a specified style and culture-specific format to its single-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed. More... | |
Public Attributes | |
internal float | m_value |
const float | MinValue = -3.40282347E+38f |
Represents the smallest possible value of T:System.Single. This field is constant. More... | |
const float | Epsilon = 1.401298E-45f |
Represents the smallest positive T:System.Single value that is greater than zero. This field is constant. More... | |
const float | MaxValue = 3.40282347E+38f |
Represents the largest possible value of T:System.Single. This field is constant. More... | |
const float | PositiveInfinity = 1f / 0f |
Represents positive infinity. This field is constant. More... | |
const float | NegativeInfinity = -1f / 0f |
Represents negative infinity. This field is constant. More... | |
const float | NaN = 0f / 0f |
Represents not a number (NaN ). This field is constant. More... | |
int System.Single.CompareTo | ( | object | value | ) |
Compares this instance to a specified object and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified object.
value | An object to compare, or null . |
null
. T:System.ArgumentException | value is not a T:System.Single. |
int System.Single.CompareTo | ( | float | value | ) |
Compares this instance to a specified single-precision floating-point number and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified single-precision floating-point number.
value | A single-precision floating-point number to compare. |
override bool System.Single.Equals | ( | object | obj | ) |
Returns a value indicating whether this instance is equal to a specified object.
obj | An object to compare with this instance. |
true
if obj is an instance of T:System.Single and equals the value of this instance; otherwise, false
.bool System.Single.Equals | ( | float | obj | ) |
Returns a value indicating whether this instance and a specified T:System.Single object represent the same value.
obj | An object to compare with this instance. |
true
if obj is equal to this instance; otherwise, false
.unsafe override int System.Single.GetHashCode | ( | ) |
TypeCode System.Single.GetTypeCode | ( | ) |
Returns the T:System.TypeCode for value type T:System.Single.
Implements System.IConvertible.
|
static |
Returns a value indicating whether the specified number evaluates to negative or positive infinity.
f | A single-precision floating-point number. |
true
if f evaluates to F:System.Single.PositiveInfinity or F:System.Single.NegativeInfinity; otherwise, false
.
|
static |
|
static |
|
static |
|
static |
Returns a value that indicates whether two specified T:System.Single values are not equal.
left | The first value to compare. |
right | The second value to compare. |
true
if left and right are not equal; otherwise, false
.
|
static |
Returns a value that indicates whether a specified T:System.Single value is greater than another specified T:System.Single value.
left | The first value to compare. |
right | The second value to compare. |
true
if left is greater than right ; otherwise, false
.
|
static |
Returns a value that indicates whether a specified T:System.Single value is greater than or equal to another specified T:System.Single value.
left | The first value to compare. |
right | The second value to compare. |
true
if left is greater than or equal to right ; otherwise, false
.
|
static |
Returns a value that indicates whether a specified T:System.Single value is less than another specified T:System.Single value.
left | The first value to compare. |
right | The second value to compare. |
true
if left is less than right ; otherwise, false
.
|
static |
Returns a value that indicates whether a specified T:System.Single value is less than or equal to another specified T:System.Single value.
left | The first value to compare. |
right | The second value to compare. |
true
if left is less than or equal to right ; otherwise, false
.
|
static |
Returns a value that indicates whether two specified T:System.Single values are equal.
left | The first value to compare. |
right | The second value to compare. |
true
if left and right are equal; otherwise, false
.
|
static |
Converts the string representation of a number to its single-precision floating-point number equivalent.
s | A string that contains a number to convert. |
T:System.ArgumentNullException | s is null . |
T:System.FormatException | s does not represent a number in a valid format. |
T:System.OverflowException | s represents a number less than F:System.Single.MinValue or greater than F:System.Single.MaxValue. |
|
static |
Converts the string representation of a number in a specified style to its single-precision floating-point number equivalent.
s | A string that contains a number to convert. |
style | A bitwise combination of enumeration values that indicates the style elements that can be present in s . A typical value to specify is F:System.Globalization.NumberStyles.Float combined with F:System.Globalization.NumberStyles.AllowThousands. |
T:System.ArgumentNullException | s is null . |
T:System.FormatException | s is not a number in a valid format. |
T:System.OverflowException | s represents a number that is less than F:System.Single.MinValue or greater than F:System.Single.MaxValue. |
T:System.ArgumentException | style is not a T:System.Globalization.NumberStyles value. -or- style includes the F:System.Globalization.NumberStyles.AllowHexSpecifier value. |
|
static |
Converts the string representation of a number in a specified culture-specific format to its single-precision floating-point number equivalent.
s | A string that contains a number to convert. |
provider | An object that supplies culture-specific formatting information about s . |
T:System.ArgumentNullException | s is null . |
T:System.FormatException | s does not represent a number in a valid format. |
T:System.OverflowException | s represents a number less than F:System.Single.MinValue or greater than F:System.Single.MaxValue. |
|
static |
Converts the string representation of a number in a specified style and culture-specific format to its single-precision floating-point number equivalent.
s | A string that contains a number to convert. |
style | A bitwise combination of enumeration values that indicates the style elements that can be present in s . A typical value to specify is F:System.Globalization.NumberStyles.Float combined with F:System.Globalization.NumberStyles.AllowThousands. |
provider | An object that supplies culture-specific formatting information about s . |
T:System.ArgumentNullException | s is null . |
T:System.FormatException | s does not represent a numeric value. |
T:System.ArgumentException | style is not a T:System.Globalization.NumberStyles value. -or- style is the F:System.Globalization.NumberStyles.AllowHexSpecifier value. |
T:System.OverflowException | s represents a number that is less than F:System.Single.MinValue or greater than F:System.Single.MaxValue. |
bool IConvertible. System.Single.ToBoolean | ( | IFormatProvider | provider | ) |
For a description of this member, see M:System.IConvertible.ToBoolean(System.IFormatProvider).
provider | This parameter is ignored. |
true
if the value of the current instance is not zero; otherwise, false
.Implements System.IConvertible.
byte IConvertible. System.Single.ToByte | ( | IFormatProvider | provider | ) |
For a description of this member, see M:System.IConvertible.ToByte(System.IFormatProvider).
provider | This parameter is ignored. |
Implements System.IConvertible.
char IConvertible. System.Single.ToChar | ( | IFormatProvider | provider | ) |
This conversion is not supported. Attempting to use this method throws an T:System.InvalidCastException.
provider | This parameter is ignored. |
T:System.InvalidCastException | In all cases. |
Implements System.IConvertible.
DateTime IConvertible. System.Single.ToDateTime | ( | IFormatProvider | provider | ) |
This conversion is not supported. Attempting to use this method throws an T:System.InvalidCastException.
provider | This parameter is ignored. |
T:System.InvalidCastException | In all cases. |
Implements System.IConvertible.
decimal IConvertible. System.Single.ToDecimal | ( | IFormatProvider | provider | ) |
For a description of this member, see M:System.IConvertible.ToDecimal(System.IFormatProvider).
provider | This parameter is ignored. |
Implements System.IConvertible.
double IConvertible. System.Single.ToDouble | ( | IFormatProvider | provider | ) |
For a description of this member, see M:System.IConvertible.ToDouble(System.IFormatProvider).
provider | This parameter is ignored. |
Implements System.IConvertible.
short IConvertible. System.Single.ToInt16 | ( | IFormatProvider | provider | ) |
For a description of this member, see M:System.IConvertible.ToInt16(System.IFormatProvider).
provider | This parameter is ignored. |
Implements System.IConvertible.
int IConvertible. System.Single.ToInt32 | ( | IFormatProvider | provider | ) |
For a description of this member, see M:System.IConvertible.ToInt32(System.IFormatProvider).
provider | This parameter is ignored. |
Implements System.IConvertible.
long IConvertible. System.Single.ToInt64 | ( | IFormatProvider | provider | ) |
For a description of this member, see M:System.IConvertible.ToInt64(System.IFormatProvider).
provider | This parameter is ignored. |
Implements System.IConvertible.
sbyte IConvertible. System.Single.ToSByte | ( | IFormatProvider | provider | ) |
For a description of this member, see M:System.IConvertible.ToSByte(System.IFormatProvider).
provider | This parameter is ignored. |
Implements System.IConvertible.
float IConvertible. System.Single.ToSingle | ( | IFormatProvider | provider | ) |
For a description of this member, see M:System.IConvertible.ToSingle(System.IFormatProvider).
provider | This parameter is ignored. |
Implements System.IConvertible.
override string System.Single.ToString | ( | ) |
string System.Single.ToString | ( | IFormatProvider | provider | ) |
Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.
provider | An object that supplies culture-specific formatting information. |
Implements System.IConvertible.
string System.Single.ToString | ( | string | format | ) |
Converts the numeric value of this instance to its equivalent string representation, using the specified format.
format | A numeric format string. |
T:System.FormatException | format is invalid. |
string System.Single.ToString | ( | string | format, |
IFormatProvider | provider | ||
) |
Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information.
format | A numeric format string. |
provider | An object that supplies culture-specific formatting information. |
Implements System.IFormattable.
object IConvertible. System.Single.ToType | ( | Type | type, |
IFormatProvider | provider | ||
) |
For a description of this member, see M:System.IConvertible.ToType(System.Type,System.IFormatProvider).
type | The type to which to convert this T:System.Single value. |
provider | An object that supplies information about the format of the returned value. |
Implements System.IConvertible.
ushort IConvertible. System.Single.ToUInt16 | ( | IFormatProvider | provider | ) |
For a description of this member, see M:System.IConvertible.ToUInt16(System.IFormatProvider).
provider | This parameter is ignored. |
Implements System.IConvertible.
uint IConvertible. System.Single.ToUInt32 | ( | IFormatProvider | provider | ) |
For a description of this member, see M:System.IConvertible.ToUInt32(System.IFormatProvider).
provider | This parameter is ignored. |
Implements System.IConvertible.
ulong IConvertible. System.Single.ToUInt64 | ( | IFormatProvider | provider | ) |
For a description of this member, see M:System.IConvertible.ToUInt64(System.IFormatProvider).
provider | This parameter is ignored. |
Implements System.IConvertible.
|
static |
Converts the string representation of a number to its single-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed.
s | A string representing a number to convert. |
result | When this method returns, contains single-precision floating-point number equivalent to the numeric value or symbol contained in s , if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or F:System.String.Empty, is not a number in a valid format, or represents a number less than F:System.Single.MinValue or greater than F:System.Single.MaxValue. This parameter is passed uninitialized; any value originally supplied in result will be overwritten. |
true
if s was converted successfully; otherwise, false
.
|
static |
Converts the string representation of a number in a specified style and culture-specific format to its single-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed.
s | A string representing a number to convert. |
style | A bitwise combination of enumeration values that indicates the permitted format of s . A typical value to specify is F:System.Globalization.NumberStyles.Float combined with F:System.Globalization.NumberStyles.AllowThousands. |
provider | An object that supplies culture-specific formatting information about s . |
result | When this method returns, contains the single-precision floating-point number equivalent to the numeric value or symbol contained in s , if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or F:System.String.Empty, is not in a format compliant with style , represents a number less than F:System.Single.MinValue or greater than F:System.Single.MaxValue, or if style is not a valid combination of T:System.Globalization.NumberStyles enumerated constants. This parameter is passed uninitialized; any value originally supplied in result will be overwritten. |
true
if s was converted successfully; otherwise, false
.T:System.ArgumentException | style is not a T:System.Globalization.NumberStyles value. -or- style is the F:System.Globalization.NumberStyles.AllowHexSpecifier value. |
const float System.Single.Epsilon = 1.401298E-45f |
Represents the smallest positive T:System.Single value that is greater than zero. This field is constant.
const float System.Single.MaxValue = 3.40282347E+38f |
Represents the largest possible value of T:System.Single. This field is constant.
const float System.Single.MinValue = -3.40282347E+38f |
Represents the smallest possible value of T:System.Single. This field is constant.
const float System.Single.NaN = 0f / 0f |
const float System.Single.NegativeInfinity = -1f / 0f |
const float System.Single.PositiveInfinity = 1f / 0f |