ILGPU  0.9.0
ILGPU.Half Struct Reference

A half precision floating point value with 16 bit precision. More...

Inheritance diagram for ILGPU.Half:

Public Member Functions

readonly bool Equals (Half other)
 Returns true if the given half is equal to the current half. More...
 
readonly int CompareTo (Half other)
 Compares this half value to the given half. More...
 
readonly override bool Equals (object obj)
 Returns true if the given object is equal to the current half. More...
 
readonly override int GetHashCode ()
 Returns the hash code of this half. More...
 
readonly override string ToString ()
 Returns the string representation of this half. More...
 

Static Public Member Functions

static Half Abs (Half half)
 Returns the absolute value of the given half value. More...
 
static bool IsNaN (Half half)
 Returns true if the given half value represents a NaN value. More...
 
static bool IsZero (Half half)
 Returns true if the given half value represents 0. More...
 
static bool IsPositiveInfinity (Half half)
 Returns true if the given half value represents +infinity. More...
 
static bool IsNegativeInfinity (Half half)
 Returns true if the given half value represents -infinity. More...
 
static bool IsInfinity (Half half)
 Returns true if the given half value represents infinity. More...
 
static Half operator- (Half halfValue)
 Negates the given half value. More...
 
static Half operator+ (Half first, Half second)
 Adds two half values. More...
 
static Half operator- (Half first, Half second)
 Subtracts two half values. More...
 
static Half operator* (Half first, Half second)
 Multiplies two half values. More...
 
static Half operator/ (Half first, Half second)
 Divides two half values. More...
 
static bool operator== (Half first, Half second)
 Returns true if the first and second half represent the same value. More...
 
static bool operator!= (Half first, Half second)
 Returns true if the first and second half represent not the same value. More...
 
static bool operator< (Half first, Half second)
 Returns true if the first half is smaller than the second half. More...
 
static bool operator<= (Half first, Half second)
 Returns true if the first half is smaller than or equal to the half index. More...
 
static bool operator> (Half first, Half second)
 Returns true if the first half is greater than the second half. More...
 
static bool operator>= (Half first, Half second)
 Returns true if the first half is greater than or equal to the second half. More...
 
static implicit operator float (Half halfValue)
 Implicitly converts a half to an float. More...
 
static implicit operator double (Half halfValue)
 Implicitly converts a half to an double. More...
 
static operator Half (float floatValue)
 Explicitly converts a float to a half. More...
 
static operator Half (double doubleValue)
 Explicitly converts a double to a half. More...
 
static operator sbyte (Half halfValue)
 Implicitly converts a half to type Int8. More...
 
static operator Half (sbyte sbyteValue)
 Explicitly converts an instance of type Int8 to a half. More...
 
static operator short (Half halfValue)
 Implicitly converts a half to type Int16. More...
 
static operator Half (short shortValue)
 Explicitly converts an instance of type Int16 to a half. More...
 
static operator int (Half halfValue)
 Implicitly converts a half to type Int32. More...
 
static operator Half (int intValue)
 Explicitly converts an instance of type Int32 to a half. More...
 
static operator long (Half halfValue)
 Implicitly converts a half to type Int64. More...
 
static operator Half (long longValue)
 Explicitly converts an instance of type Int64 to a half. More...
 
static operator byte (Half halfValue)
 Implicitly converts a half to type UInt8. More...
 
static operator Half (byte byteValue)
 Explicitly converts an instance of type UInt8 to a half. More...
 
static operator ushort (Half halfValue)
 Implicitly converts a half to type UInt16. More...
 
static operator Half (ushort ushortValue)
 Explicitly converts an instance of type UInt16 to a half. More...
 
static operator uint (Half halfValue)
 Implicitly converts a half to type UInt32. More...
 
static operator Half (uint uintValue)
 Explicitly converts an instance of type UInt32 to a half. More...
 
static operator ulong (Half halfValue)
 Implicitly converts a half to type UInt64. More...
 
static operator Half (ulong ulongValue)
 Explicitly converts an instance of type UInt64 to a half. More...
 

Static Public Attributes

static readonly Half Epsilon = new Half(0x1)
 Represents the smallest positive Half value that is greater than zero. More...
 
static readonly Half MaxValue
 Represents the largest possible Half value. More...
 
static readonly Half MinValue
 Represents the smallest possible Half value. More...
 
static readonly Half NaN = new Half(0xFC01)
 Represents not a number (NaN). More...
 
static readonly Half PositiveInfinity
 Represents positive infinity. More...
 
static readonly Half NegativeInfinity
 Represents negative infinity. More...
 
static readonly Half Zero = new Half(0x0)
 Represents a positive zero Half value. More...
 
static readonly Half One = new Half(0x1)
 Represents a positive zero Half value. More...
 

Detailed Description

A half precision floating point value with 16 bit precision.

Member Function Documentation

static Half ILGPU.Half.Abs ( Half  half)
static

Returns the absolute value of the given half value.

Parameters
halfThe half value.
Returns
The absolute value.
readonly int ILGPU.Half.CompareTo ( Half  other)

Compares this half value to the given half.

Parameters
otherThe other half.
Returns
The result of the half comparison.
readonly bool ILGPU.Half.Equals ( Half  other)

Returns true if the given half is equal to the current half.

Parameters
otherThe other half.
Returns
True, if the given half is equal to the current half.
readonly override bool ILGPU.Half.Equals ( object  obj)

Returns true if the given object is equal to the current half.

Parameters
objThe other object.
Returns
True, if the given object is equal to the current half.
readonly override int ILGPU.Half.GetHashCode ( )

Returns the hash code of this half.

Returns
The hash code of this half.
static bool ILGPU.Half.IsInfinity ( Half  half)
static

Returns true if the given half value represents infinity.

Parameters
halfThe half value.
Returns
True, if the given half value represents infinity.
static bool ILGPU.Half.IsNaN ( Half  half)
static

Returns true if the given half value represents a NaN value.

Parameters
halfThe half value.
Returns
True, if the given half represents a NaN value.
static bool ILGPU.Half.IsNegativeInfinity ( Half  half)
static

Returns true if the given half value represents -infinity.

Parameters
halfThe half value.
Returns
True, if the given half value represents -infinity.
static bool ILGPU.Half.IsPositiveInfinity ( Half  half)
static

Returns true if the given half value represents +infinity.

Parameters
halfThe half value.
Returns
True, if the given half value represents +infinity.
static bool ILGPU.Half.IsZero ( Half  half)
static

Returns true if the given half value represents 0.

Parameters
halfThe half value.
Returns
True, if the given half represents 0.
static ILGPU.Half.operator byte ( Half  halfValue)
explicitstatic

Implicitly converts a half to type UInt8.

Parameters
halfValueThe half to convert.
static implicit ILGPU.Half.operator double ( Half  halfValue)
static

Implicitly converts a half to an double.

Parameters
halfValueThe half to convert.
static implicit ILGPU.Half.operator float ( Half  halfValue)
static

Implicitly converts a half to an float.

Parameters
halfValueThe half to convert.
static ILGPU.Half.operator Half ( sbyte  sbyteValue)
explicitstatic

Explicitly converts an instance of type Int8 to a half.

Parameters
sbyteValueThe value to convert.
static ILGPU.Half.operator Half ( short  shortValue)
explicitstatic

Explicitly converts an instance of type Int16 to a half.

Parameters
shortValueThe value to convert.
static ILGPU.Half.operator Half ( int  intValue)
explicitstatic

Explicitly converts an instance of type Int32 to a half.

Parameters
intValueThe value to convert.
static ILGPU.Half.operator Half ( long  longValue)
explicitstatic

Explicitly converts an instance of type Int64 to a half.

Parameters
longValueThe value to convert.
static ILGPU.Half.operator Half ( byte  byteValue)
explicitstatic

Explicitly converts an instance of type UInt8 to a half.

Parameters
byteValueThe value to convert.
static ILGPU.Half.operator Half ( ushort  ushortValue)
explicitstatic

Explicitly converts an instance of type UInt16 to a half.

Parameters
ushortValueThe value to convert.
static ILGPU.Half.operator Half ( uint  uintValue)
explicitstatic

Explicitly converts an instance of type UInt32 to a half.

Parameters
uintValueThe value to convert.
static ILGPU.Half.operator Half ( ulong  ulongValue)
explicitstatic

Explicitly converts an instance of type UInt64 to a half.

Parameters
ulongValueThe value to convert.
static ILGPU.Half.operator Half ( float  floatValue)
explicitstatic

Explicitly converts a float to a half.

Parameters
floatValueThe float to convert.
static ILGPU.Half.operator Half ( double  doubleValue)
explicitstatic

Explicitly converts a double to a half.

Parameters
doubleValueThe double to convert.
static ILGPU.Half.operator int ( Half  halfValue)
explicitstatic

Implicitly converts a half to type Int32.

Parameters
halfValueThe half to convert.
static ILGPU.Half.operator long ( Half  halfValue)
explicitstatic

Implicitly converts a half to type Int64.

Parameters
halfValueThe half to convert.
static ILGPU.Half.operator sbyte ( Half  halfValue)
explicitstatic

Implicitly converts a half to type Int8.

Parameters
halfValueThe half to convert.
static ILGPU.Half.operator short ( Half  halfValue)
explicitstatic

Implicitly converts a half to type Int16.

Parameters
halfValueThe half to convert.
static ILGPU.Half.operator uint ( Half  halfValue)
explicitstatic

Implicitly converts a half to type UInt32.

Parameters
halfValueThe half to convert.
static ILGPU.Half.operator ulong ( Half  halfValue)
explicitstatic

Implicitly converts a half to type UInt64.

Parameters
halfValueThe half to convert.
static ILGPU.Half.operator ushort ( Half  halfValue)
explicitstatic

Implicitly converts a half to type UInt16.

Parameters
halfValueThe half to convert.
static bool ILGPU.Half.operator!= ( Half  first,
Half  second 
)
static

Returns true if the first and second half represent not the same value.

Parameters
firstThe first value.
secondThe second value.
Returns
True, if the first and second half are not the same.
static Half ILGPU.Half.operator* ( Half  first,
Half  second 
)
static

Multiplies two half values.

Parameters
firstThe first half.
secondThe second half.
Returns
The resulting half value.
static Half ILGPU.Half.operator+ ( Half  first,
Half  second 
)
static

Adds two half values.

Parameters
firstThe first half.
secondThe second half.
Returns
The resulting half value.
static Half ILGPU.Half.operator- ( Half  halfValue)
static

Negates the given half value.

Parameters
halfValueThe half value to negate.
Returns
The negated half value.
static Half ILGPU.Half.operator- ( Half  first,
Half  second 
)
static

Subtracts two half values.

Parameters
firstThe first half.
secondThe second half.
Returns
The resulting half value.
static Half ILGPU.Half.operator/ ( Half  first,
Half  second 
)
static

Divides two half values.

Parameters
firstThe first half.
secondThe second half.
Returns
The resulting half value.
static bool ILGPU.Half.operator< ( Half  first,
Half  second 
)
static

Returns true if the first half is smaller than the second half.

Parameters
firstThe first half.
secondThe second half.
Returns
True, if the first half is smaller than the second half.
static bool ILGPU.Half.operator<= ( Half  first,
Half  second 
)
static

Returns true if the first half is smaller than or equal to the half index.

Parameters
firstThe first half.
secondThe second half.
Returns
True, if the first half is smaller than or equal to the second half.
static bool ILGPU.Half.operator== ( Half  first,
Half  second 
)
static

Returns true if the first and second half represent the same value.

Parameters
firstThe first value.
secondThe second value.
Returns
True, if the first and second half are the same.
static bool ILGPU.Half.operator> ( Half  first,
Half  second 
)
static

Returns true if the first half is greater than the second half.

Parameters
firstThe first half.
secondThe second half.
Returns
True, if the first half is greater than the second half.
static bool ILGPU.Half.operator>= ( Half  first,
Half  second 
)
static

Returns true if the first half is greater than or equal to the second half.

Parameters
firstThe first index.
secondThe second index.
Returns
True, if the first index is greater than or equal to the second index.
readonly override string ILGPU.Half.ToString ( )

Returns the string representation of this half.

Returns
The string representation of this half.

Member Data Documentation

readonly Half ILGPU.Half.Epsilon = new Half(0x1)
static

Represents the smallest positive Half value that is greater than zero.

readonly Half ILGPU.Half.MaxValue
static
Initial value:
= new Half(
0x7BFF)

Represents the largest possible Half value.

readonly Half ILGPU.Half.MinValue
static
Initial value:
= new Half(
0xFBFF)

Represents the smallest possible Half value.

readonly Half ILGPU.Half.NaN = new Half(0xFC01)
static

Represents not a number (NaN).

readonly Half ILGPU.Half.NegativeInfinity
static
Initial value:
= new Half(
0xFC00)

Represents negative infinity.

readonly Half ILGPU.Half.One = new Half(0x1)
static

Represents a positive zero Half value.

readonly Half ILGPU.Half.PositiveInfinity
static
Initial value:
= new Half(
0x7C00)

Represents positive infinity.

readonly Half ILGPU.Half.Zero = new Half(0x0)
static

Represents a positive zero Half value.


The documentation for this struct was generated from the following files: