12 [__DynamicallyInvokable]
15 internal float m_value;
18 [__DynamicallyInvokable]
19 public const float MinValue = -3.40282347E+38f;
22 [__DynamicallyInvokable]
23 public const float Epsilon = 1.401298E-45f;
26 [__DynamicallyInvokable]
30 [__DynamicallyInvokable]
34 [__DynamicallyInvokable]
38 [__DynamicallyInvokable]
39 public const float NaN = 0f / 0f;
45 [SecuritySafeCritical]
47 [__DynamicallyInvokable]
50 return (*(
int*)(&f) &
int.
MaxValue) == 2139095040;
57 [SecuritySafeCritical]
59 [__DynamicallyInvokable]
62 return *(
int*)(&f) == 2139095040;
69 [SecuritySafeCritical]
71 [__DynamicallyInvokable]
74 return *(
int*)(&f) == -8388608;
81 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
82 [SecuritySafeCritical]
84 [__DynamicallyInvokable]
85 public unsafe
static bool IsNaN(
float f)
87 return (*(
int*)(&f) &
int.
MaxValue) > 2139095040;
104 float num = (float)value;
133 [__DynamicallyInvokable]
165 [__DynamicallyInvokable]
168 return left == right;
177 [__DynamicallyInvokable]
180 return left != right;
189 [__DynamicallyInvokable]
201 [__DynamicallyInvokable]
213 [__DynamicallyInvokable]
216 return left <= right;
225 [__DynamicallyInvokable]
228 return left >= right;
235 [__DynamicallyInvokable]
242 float num = (float)obj;
258 [__DynamicallyInvokable]
274 [SecuritySafeCritical]
275 [__DynamicallyInvokable]
283 return *(
int*)(&num);
288 [SecuritySafeCritical]
289 [__DynamicallyInvokable]
298 [SecuritySafeCritical]
299 [__DynamicallyInvokable]
310 [SecuritySafeCritical]
311 [__DynamicallyInvokable]
321 [SecuritySafeCritical]
322 [__DynamicallyInvokable]
337 [__DynamicallyInvokable]
356 [__DynamicallyInvokable]
373 [__DynamicallyInvokable]
393 [__DynamicallyInvokable]
402 return Number.ParseSingle(s, style, info);
410 [__DynamicallyInvokable]
411 public static bool TryParse(
string s, out
float result)
426 [__DynamicallyInvokable]
440 if (!Number.TryParseSingle(s, style, info, out result))
442 string text = s.Trim();
443 if (text.Equals(info.PositiveInfinitySymbol))
445 result =
float.PositiveInfinity;
447 else if (text.Equals(info.NegativeInfinitySymbol))
449 result =
float.NegativeInfinity;
453 if (!text.Equals(info.NaNSymbol))
474 [__DynamicallyInvokable]
484 [__DynamicallyInvokable]
493 [__DynamicallyInvokable]
502 [__DynamicallyInvokable]
511 [__DynamicallyInvokable]
520 [__DynamicallyInvokable]
529 [__DynamicallyInvokable]
538 [__DynamicallyInvokable]
547 [__DynamicallyInvokable]
556 [__DynamicallyInvokable]
565 [__DynamicallyInvokable]
574 [__DynamicallyInvokable]
583 [__DynamicallyInvokable]
593 [__DynamicallyInvokable]
603 [__DynamicallyInvokable]
606 return Convert.DefaultToType(
this, type, provider);
float ToSingle(IFormatProvider provider)
Converts the value of this instance to an equivalent single-precision floating-point number using the...
Converts a base data type to another base data type.
static float Parse(string s)
Converts the string representation of a number to its single-precision floating-point number equivale...
static long ToInt64(object value)
Converts the value of the specified object to a 64-bit signed integer.
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 it...
static double ToDouble(object value)
Converts the value of the specified object to a double-precision floating-point number.
string ToString(string format)
Converts the numeric value of this instance to its equivalent string representation,...
const float MaxValue
Represents the largest possible value of T:System.Single. This field is constant.
const float NaN
Represents not a number (NaN). This field is constant.
double ToDouble(IFormatProvider provider)
Converts the value of this instance to an equivalent double-precision floating-point number using the...
bool ToBoolean(IFormatProvider provider)
Converts the value of this instance to an equivalent Boolean value using the specified culture-specif...
TypeCode
Specifies the type of an object.
The exception that is thrown for invalid casting or explicit conversion.
char ToChar(IFormatProvider provider)
Converts the value of this instance to an equivalent Unicode character using the specified culture-sp...
static bool operator !=(float left, float right)
Returns a value that indicates whether two specified T:System.Single values are not equal.
static unsafe bool IsNaN(float f)
Returns a value that indicates whether the specified value is not a number (F:System....
Represents an instant in time, typically expressed as a date and time of day. To browse the ....
int CompareTo(object value)
Compares this instance to a specified object and returns an integer that indicates whether the value ...
DateTime ToDateTime(IFormatProvider provider)
Converts the value of this instance to an equivalent T:System.DateTime using the specified culture-sp...
sbyte ToSByte(IFormatProvider provider)
Converts the value of this instance to an equivalent 8-bit signed integer using the specified culture...
Defines a generalized type-specific comparison method that a value type or class implements to order ...
static bool operator<(float left, float right)
Returns a value that indicates whether a specified T:System.Single value is less than another specifi...
NumberStyles
Determines the styles permitted in numeric string arguments that are passed to the Parse and TryParse...
Cer
Specifies a method's behavior when called within a constrained execution region.
unsafe override int GetHashCode()
Returns the hash code for this instance.
const float Epsilon
Represents the smallest positive T:System.Single value that is greater than zero. This field is const...
Provides information about, and means to manipulate, the current environment and platform....
static bool ToBoolean(object value)
Converts the value of a specified object to an equivalent Boolean value.
decimal ToDecimal(IFormatProvider provider)
Converts the value of this instance to an equivalent T:System.Decimal number using the specified cult...
int ToInt32(IFormatProvider provider)
Converts the value of this instance to an equivalent 32-bit signed integer using the specified cultur...
static bool operator==(float left, float right)
Returns a value that indicates whether two specified T:System.Single values are equal.
const float NegativeInfinity
Represents negative infinity. This field is constant.
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 ano...
static ushort ToUInt16(object value)
Converts the value of the specified object to a 16-bit unsigned integer.
object ToType(Type conversionType, IFormatProvider provider)
Converts the value of this instance to an T:System.Object of the specified T:System....
static sbyte ToSByte(object value)
Converts the value of the specified object to an 8-bit signed integer.
override string ToString()
Converts the numeric value of this instance to its equivalent string representation.
Represents type declarations: class types, interface types, array types, value types,...
ushort ToUInt16(IFormatProvider provider)
Converts the value of this instance to an equivalent 16-bit unsigned integer using the specified cult...
static bool TryParse(string s, out float result)
Converts the string representation of a number to its single-precision floating-point number equivale...
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 ...
static uint ToUInt32(object value)
Converts the value of the specified object to a 32-bit unsigned integer.
Represents a single-precision floating-point number.
string ToString(string format, IFormatProvider provider)
Converts the numeric value of this instance to its equivalent string representation using the specifi...
TypeCode GetTypeCode()
Returns the T:System.TypeCode for value type T:System.Single.
short ToInt16(IFormatProvider provider)
Converts the value of this instance to an equivalent 16-bit signed integer using the specified cultur...
static decimal ToDecimal(object value)
Converts the value of the specified object to an equivalent decimal number.
static unsafe bool IsPositiveInfinity(float f)
Returns a value indicating whether the specified number evaluates to positive infinity.
long ToInt64(IFormatProvider provider)
Converts the value of this instance to an equivalent 64-bit signed integer using the specified cultur...
The exception that is thrown when one of the arguments provided to a method is not valid.
static float Parse(string s, NumberStyles style)
Converts the string representation of a number in a specified style to its single-precision floating-...
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 it...
static unsafe bool IsInfinity(float f)
Returns a value indicating whether the specified number evaluates to negative or positive infinity.
static byte ToByte(object value)
Converts the value of the specified object to an 8-bit unsigned integer.
Defines a generalized method that a value type or class implements to create a type-specific method f...
static bool operator >(float left, float right)
Returns a value that indicates whether a specified T:System.Single value is greater than another spec...
int CompareTo(float value)
Compares this instance to a specified single-precision floating-point number and returns an integer t...
static short ToInt16(object value)
Converts the value of the specified object to a 16-bit signed integer.
Specifies that the class can be serialized.
override bool Equals(object obj)
Returns a value indicating whether this instance is equal to a specified object.
Consistency
Specifies a reliability contract.
ulong ToUInt64(IFormatProvider provider)
Converts the value of this instance to an equivalent 64-bit unsigned integer using the specified cult...
static ulong ToUInt64(object value)
Converts the value of the specified object to a 64-bit unsigned integer.
static int ToInt32(object value)
Converts the value of the specified object to a 32-bit signed integer.
byte ToByte(IFormatProvider provider)
Converts the value of this instance to an equivalent 8-bit unsigned integer using the specified cultu...
Defines methods that convert the value of the implementing reference or value type to a common langua...
static float Parse(string s, IFormatProvider provider)
Converts the string representation of a number in a specified culture-specific format to its single-p...
const float PositiveInfinity
Represents positive infinity. This field is constant.
const float MinValue
Represents the smallest possible value of T:System.Single. This field is constant.
static unsafe bool IsNegativeInfinity(float f)
Returns a value indicating whether the specified number evaluates to negative infinity.
uint ToUInt32(IFormatProvider provider)
Converts the value of this instance to an equivalent 32-bit unsigned integer using the specified cult...
string ToString(IFormatProvider provider)
Converts the numeric value of this instance to its equivalent string representation using the specifi...
bool Equals(float obj)
Returns a value indicating whether this instance and a specified T:System.Single object represent the...