Search Results for

    Show / Hide Table of Contents

    Class Half

    A half precision (16 bit) floating point value.

    Inheritance
    System.Object
    Half
    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

    A Half whose value is 1.0f.

    Declaration
    public static readonly Half One
    Field Value
    Half

    PrecisionDigits

    Number of decimal digits of precision.

    Declaration
    public const int PrecisionDigits = 3
    Field Value
    System.Int32

    Zero

    A Half whose value is 0.0f.

    Declaration
    public static readonly Half Zero
    Field Value
    Half

    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

    true if the current instance is equal to the specified object; false otherwise.

    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

    true if value1 is the same instance as value2 or if both are null references or if value1.Equals(value2) returns true; otherwise, false.

    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

    true if the current instance is equal to the specified object; false otherwise.

    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

    true if left has the same value as right; otherwise, false.

    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

    true if left has a different value than right; otherwise, false.

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.RawClone<T>(T)
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat