コード例 #1
0
        /// <summary>
        ///     Converts an array of half precision values into full precision values.
        /// </summary>
        /// <param name="values">The values to be converted.</param>
        /// <returns>An array of converted values.</returns>
        public static float[] ConvertToFloat(Half[] values)
        {
            var results = new float[values.Length];

            for (var i = 0; i < results.Length; i++)
            {
                results[i] = HalfUtils.Unpack(values[i].RawValue);
            }
            return(results);
        }
コード例 #2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="Half" /> structure.
 /// </summary>
 /// <param name="value">The floating point value that should be stored in 16 bit format.</param>
 public Half(float value)
 {
     RawValue = HalfUtils.Pack(value);
 }