Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

struct System.​Runtime.​InteropServices.​NFloat

Assembly: System.Runtime.InteropServices

<see cref="T:System.Runtime.InteropServices.NFloat" /> is an immutable value type that represents a floating type that has the same size as the native integer size. It is meant to be used as an exchange type at the managed/unmanaged boundary to accurately represent in managed code unmanaged APIs that use a type alias for C or C++'s <c>float</c> on 32-bit platforms or <c>double</c> on 64-bit platforms, such as the CGFloat type in libraries provided by Apple.

Properties

public double
Value
The underlying floating-point value of this instance.

Methods

public int
CompareTo​(object obj)
obj An object to compare, or <see langword="null" /> .
Returns <para>A signed number indicating the relative values of this instance and <paramref name="obj" />.</para> <list type="table"> <listheader> <term>Return Value</term> <description>Description</description> </listheader> <item> <term>Less than zero</term> <description>This instance is less than <paramref name="obj" />, or this instance is not a number and <paramref name="obj" /> is a number.</description> </item> <item> <term>Zero</term> <description>This instance is equal to <paramref name="obj" />, or both this instance and <paramref name="obj" /> are not a number.</description> </item> <item> <term>Greater than zero</term> <description>This instance is greater than <paramref name="obj" />, or this instance is a number and <paramref name="obj" /> is not a number or <paramref name="obj" /> is <see langword="null" />.</description> </item> </list>
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.
public int
CompareTo​(NFloat other)
other A floating-point number to compare.
Returns <para>A signed number indicating the relative values of this instance and <paramref name="other" />.</para> <list type="table"> <listheader> <term>Return Value</term> <description>Description</description> </listheader> <item> <term>Less than zero</term> <description>This instance is less than <paramref name="other" />, or this instance is not a number and <paramref name="other" /> is a number.</description> </item> <item> <term>Zero</term> <description>This instance is equal to <paramref name="other" />, or both this instance and <paramref name="other" /> are not a number.</description> </item> <item> <term>Greater than zero</term> <description>This instance is greater than <paramref name="other" />, or this instance is a number and <paramref name="other" /> is not a number.</description> </item> </list>
Compares this instance to a specified 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 floating-point number.
public bool
Equals​(object obj)
obj An object to compare with this instance.
Returns <see langword="true" /> if <paramref name="o" /> is an instance of <see cref="T:System.Runtime.InteropServices.NFloat" /> and equals the value of this instance; otherwise, <see langword="false" /> .
Returns a value indicating whether this instance is equal to a specified object.
public bool
Equals​(NFloat other)
other An <see cref="T:System.Runtime.InteropServices.NFloat" /> value to compare to this instance.
Returns <see langword="true" /> if <paramref name="other" /> has the same value as this instance; otherwise, <see langword="false" /> .
Returns a value indicating whether this instance is equal to a specified <see cref="T:System.Runtime.InteropServices.CLong" /> value.
public int
GetHashCode​()
Returns A 32-bit signed integer hash code.
Returns the hash code for this instance.
public string
ToString​()
Returns The string representation of the value of this instance.
Converts the numeric value of this instance to its equivalent string representation.
public string
ToString​(IFormatProvider provider)
provider An object that supplies culture-specific formatting information.
Returns The string representation of the value of this instance as specified by <paramref name="provider" /> .
Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.
public string
ToString​(string format)
format A numeric format string.
Returns The string representation of the value of this instance as specified by <paramref name="format" /> .
Converts the numeric value of this instance to its equivalent string representation using the specified format.
public string
ToString​(string format, IFormatProvider provider)
format A numeric format string.
provider An object that supplies culture-specific formatting information.
Returns The string representation of the value of this instance as specified by <paramref name="format" /> and <paramref name="provider" /> .
Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information.
public bool
TryFormat​(Span`1 destination, Int32& charsWritten, ReadOnlySpan`1 format = null, IFormatProvider provider = null)
public bool
TryFormat​(Span`1 utf8Destination, Int32& bytesWritten, ReadOnlySpan`1 format = null, IFormatProvider provider = null)
protected void
Finalize​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object