Bewerken

Delen via


nfloat Struct

Definition

Native floating point (single precision on 32-bit platforms, double precision on 64-bit platforms)

[System.Serializable]
public struct nfloat : IComparable, IComparable<nfloat>, IConvertible, IEquatable<nfloat>, IFormattable
type nfloat = struct
    interface IFormattable
    interface IConvertible
Inheritance
nfloat
Attributes
Implements

Remarks

This data type is a floating point value that uses the natural size of the host architecture to store its value.  On 32-bit systems, this uses T:System.Single for storage and on 64-bit systems it uses T:System.Double for storage.

As an optimization, the compiler and runtime have special knowledge of this data type, so while there is no dedicated set of IL instructions to deal with variable-size floating point values, the runtime will transform uses of nfloat into their native underlying representation transparently.

This type is defined in lowercase because it makes it feel like a C# data type when used in C# source code.

Constructors

nfloat(Double)

Initializes an nfloat from a double value.   On 32 bit platforms, this might be a lossy initialization.

nfloat(Single)

Initializes an nfloat from a float value.

Fields

Epsilon

Represents the smallest positive nfloat value that is greater than zero. This field is constant.

MaxValue

Represents the largest possible value of a nfloat. This field is constant.

MinValue

Represents the smallest possible value of a T:System.Double. This field is constant.

NaN
NegativeInfinity
PositiveInfinity
Size

Methods

CompareTo(nfloat)

Compares this instance to a specified nfloat 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 nfloat floating-point number.

CompareTo(Object)

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.

CopyArray(IntPtr, nfloat[], Int32, Int32)
CopyArray(nfloat[], Int32, IntPtr, Int32)
Equals(nfloat)

Returns a value indicating whether this instance and a specified nfloat object represent the same value.

Equals(Object)

Returns a value indicating whether this instance is equal to a specified object.

GetHashCode()
GetTypeCode()

Returns the T:System.TypeCode for the underlying storage on this platform, either the typecode for T:System.Double or the typecode for T:System.Single.

IsInfinity(nfloat)

Returns a value indicating whether the specified number evaluates to negative or positive infinity.

IsNaN(nfloat)

Returns a value that indicates whether the specified value is not a number (NaN).

IsNegativeInfinity(nfloat)
IsPositiveInfinity(nfloat)
Parse(String, IFormatProvider)

Converts the string representation of a number in a specified culture-specific format to its double-precision floating-point number equivalent.

Parse(String, NumberStyles, IFormatProvider)
Parse(String, NumberStyles)
Parse(String)

Converts the string representation of a number to its double-precision floating-point number equivalent.

ToString()
ToString(IFormatProvider)
ToString(String, IFormatProvider)
ToString(String)
TryParse(String, nfloat)
TryParse(String, NumberStyles, IFormatProvider, nfloat)

Operators

Addition(nfloat, nfloat)
Decrement(nfloat)
Division(nfloat, nfloat)
Equality(nfloat, nfloat)
Explicit(Decimal to nfloat)
Explicit(Double to nfloat)
Explicit(IntPtr to nfloat)
Explicit(nfloat to Byte)
Explicit(nfloat to Char)
Explicit(nfloat to Decimal)
Explicit(nfloat to Int16)
Explicit(nfloat to Int32)
Explicit(nfloat to Int64)
Explicit(nfloat to IntPtr)
Explicit(nfloat to SByte)
Explicit(nfloat to Single)
Explicit(nfloat to UInt16)
Explicit(nfloat to UInt32)
Explicit(nfloat to UInt64)
GreaterThan(nfloat, nfloat)
GreaterThanOrEqual(nfloat, nfloat)
Implicit(Byte to nfloat)
Implicit(Char to nfloat)
Implicit(Int16 to nfloat)
Implicit(Int32 to nfloat)
Implicit(Int64 to nfloat)
Implicit(nfloat to Double)
Implicit(SByte to nfloat)
Implicit(Single to nfloat)
Implicit(UInt16 to nfloat)
Implicit(UInt32 to nfloat)
Implicit(UInt64 to nfloat)
Increment(nfloat)
Inequality(nfloat, nfloat)
LessThan(nfloat, nfloat)
LessThanOrEqual(nfloat, nfloat)
Modulus(nfloat, nfloat)
Multiply(nfloat, nfloat)
Subtraction(nfloat, nfloat)
UnaryNegation(nfloat)
UnaryPlus(nfloat)

Explicit Interface Implementations

IConvertible.ToBoolean(IFormatProvider)
IConvertible.ToByte(IFormatProvider)
IConvertible.ToChar(IFormatProvider)
IConvertible.ToDateTime(IFormatProvider)
IConvertible.ToDecimal(IFormatProvider)
IConvertible.ToDouble(IFormatProvider)
IConvertible.ToInt16(IFormatProvider)
IConvertible.ToInt32(IFormatProvider)
IConvertible.ToInt64(IFormatProvider)
IConvertible.ToSByte(IFormatProvider)
IConvertible.ToSingle(IFormatProvider)
IConvertible.ToType(Type, IFormatProvider)
IConvertible.ToUInt16(IFormatProvider)
IConvertible.ToUInt32(IFormatProvider)
IConvertible.ToUInt64(IFormatProvider)

Applies to