Half Struct

Definition

The name Half is derived from half-precision floating-point number. It occupies only 16 Bits, which are split into 1 Sign bit, 5 Exponent bits and 10 Mantissa bits.

[System.Serializable]
public struct Half : IComparable<OpenTK.Half>, IEquatable<OpenTK.Half>, IFormattable, System.Runtime.Serialization.ISerializable
type Half = struct
    interface ISerializable
    interface IFormattable
Inheritance
Half
Attributes
Implements

Remarks

Quote from ARB_half_float_pixel specification: Any representable 16-bit floating-point value is legal as input to a GL command that accepts 16-bit floating-point data. The result of providing a value that is not a floating-point number (such as infinity or NaN) to such a command is unspecified, but must not lead to GL interruption or termination. Providing a denormalized number or negative zero to GL must yield predictable results.

Constructors

Half(Double)

The new Half instance will convert the parameter into 16-Bit Half precision floating point.

Half(Double, Boolean)

The new Half instance will convert the parameter into 16-Bit Half precision floating point.

Half(SerializationInfo, StreamingContext)

Constructor used by ISerializable to deserialize the object.

Half(Single)

The new Half instance will convert the parameter into 16-Bit Half precision floating point.

Half(Single, Boolean)

The new Half instance will convert the parameter into 16-Bit Half precision floating point.

Fields

Epsilon

Smallest positive e for which half (1.0 + e) != half (1.0)

MaxValue

Largest positive half

MinNormalizedValue

Smallest positive normalized half

MinValue

Smallest positive half

SizeInBytes

The size in bytes for an instance of the Half struct.

Properties

IsNaN

Returns true if the Half represents Not A Number (NaN)

IsNegativeInfinity

Returns true if the Half represents negative infinity.

IsPositiveInfinity

Returns true if the Half represents positive infinity.

IsZero

Returns true if the Half is zero.

Methods

CompareTo(Half)

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

Equals(Half)

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

FromBinaryStream(BinaryReader)

Updates the Half by reading from a Stream.

FromBytes(Byte[], Int32)
GetBytes(Half)

Returns the Half as an array of bytes.

GetObjectData(SerializationInfo, StreamingContext)

Used by ISerialize to serialize the object.

Parse(String)
Parse(String, NumberStyles, IFormatProvider)
ToBinaryStream(BinaryWriter)

Writes the Half into a Stream.

ToSingle()

Converts the 16-Bit half to 32-Bit floating point.

ToString()

Converts this Half into a human-legible string representation.

ToString(String, IFormatProvider)

Converts this Half into a human-legible string representation.

TryParse(String, Half)

Converts the string representation of a number to a Half precision floating point equivalent. Returns success.

TryParse(String, NumberStyles, IFormatProvider, Half)

Converts the string representation of a number to a Half precision floating point equivalent. Returns success.

Operators

Explicit(Double to Half)
Explicit(Single to Half)
Implicit(Half to Double)

Converts a OpenTK.Half to a System.Double.

Implicit(Half to Single)

Converts a OpenTK.Half to a System.Single.

Applies to