Class Half
A half precision (16 bit) floating point value.
Inheritance
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
public sealed class Half : ValueType
Constructors
Half(Single)
Initializes a new instance of the Half structure.
Declaration
public Half(float value)
Parameters
System.Single
value
The floating point value that should be stored in 16 bit format. |
Fields
AdditionRounding
Additional rounding.
Declaration
public const int AdditionRounding = 1
Field Value
System.Int32
|
Epsilon
Smallest such that 1.0 + epsilon != 1.0
Declaration
public static readonly float Epsilon
Field Value
System.Single
|
ExponentRadix
Exponent radix.
Declaration
public const int ExponentRadix = 2
Field Value
System.Int32
|
MantissaBits
Number of bits in the mantissa.
Declaration
public const int MantissaBits = 11
Field Value
System.Int32
|
MaximumBinaryExponent
Maximum binary exponent.
Declaration
public const int MaximumBinaryExponent = 15
Field Value
System.Int32
|
MaximumDecimalExponent
Maximum decimal exponent.
Declaration
public const int MaximumDecimalExponent = 4
Field Value
System.Int32
|
MaxValue
Maximum value of the number.
Declaration
public static readonly float MaxValue
Field Value
System.Single
|
MinimumBinaryExponent
Minimum binary exponent.
Declaration
public const int MinimumBinaryExponent = -14
Field Value
System.Int32
|
MinimumDecimalExponent
Minimum decimal exponent.
Declaration
public const int MinimumDecimalExponent = -4
Field Value
System.Int32
|
MinValue
Minimum value of the number.
Declaration
public static readonly float MinValue
Field Value
System.Single
|
One
PrecisionDigits
Number of decimal digits of precision.
Declaration
public const int PrecisionDigits = 3
Field Value
System.Int32
|
Zero
Properties
RawValue
Gets or sets the raw 16 bit value used to back this half-float.
Declaration
public ushort RawValue { get; }
Property Value
System.UInt16
|
Methods
ConvertToFloat(Half[])
Converts an array of half precision values into full precision values.
Declaration
public static float[] ConvertToFloat(Half[] values)
Parameters
Half[]
values
The values to be converted. |
Returns
System.Single[]
An array of converted values. |
ConvertToHalf(Single[])
Converts an array of full precision values into half precision values.
Declaration
public static Half[] ConvertToHalf(float[] values)
Parameters
System.Single[]
values
The values to be converted. |
Returns
Half[]
An array of converted values. |
Equals(Half)
Returns a value that indicates whether the current instance is equal to the specified object.
Declaration
public bool Equals(Half other)
Parameters
Half
other
Object to make the comparison with. |
Returns
System.Boolean
|
Equals(ref Half, ref Half)
Determines whether the specified object instances are considered equal.
Declaration
public static bool Equals(ref Half value1, ref Half value2)
Parameters
Half
value1
|
Half
value2
|
Returns
System.Boolean
|
Equals(Object)
Returns a value that indicates whether the current instance is equal to a specified object.
Declaration
public override bool Equals(object obj)
Parameters
System.Object
obj
Object to make the comparison with. |
Returns
System.Boolean
|
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
System.Int32
A 32-bit signed integer hash code. |
ToString()
Converts the value of the object to its equivalent string representation.
Declaration
public override string ToString()
Returns
System.String
The string representation of the value of this instance. |
Operators
Equality(Half, Half)
Tests for equality between two objects.
Declaration
public static bool operator ==(Half left, Half right)
Parameters
Half
left
The first value to compare. |
Half
right
The second value to compare. |
Returns
System.Boolean
|
Explicit(Single to Half)
Performs an explicit conversion from System.Single to Half.
Declaration
public static explicit operator Half(float value)
Parameters
System.Single
value
The value to be converted. |
Returns
Half
The converted value. |
Implicit(Half to Single)
Performs an implicit conversion from Half to System.Single.
Declaration
public static implicit operator float (Half value)
Parameters
Half
value
The value to be converted. |
Returns
System.Single
The converted value. |
Inequality(Half, Half)
Tests for inequality between two objects.
Declaration
public static bool operator !=(Half left, Half right)
Parameters
Half
left
The first value to compare. |
Half
right
The second value to compare. |
Returns
System.Boolean
|