Exemplo n.º 1
0
        /// <summary>
        /// Returns the smallest value which is larger than <paramref name="value"/>.
        /// Does not handle NaN or Infinity.
        /// </summary>
        /// <returns>The smallest value which is larger than <paramref name="value"/>.</returns>
        internal static float Incremented(float value)
        {
            var temp = new Float32(value);

            // Incrementing the integer representation gives the next float.
            temp._valueI++;
            return(temp._valueF);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns the largest value which is less than <paramref name="value"/>.
        /// Does not handle NaN or Infinity.
        /// </summary>
        /// <returns>The largest value which is less than <paramref name="value"/>.</returns>
        internal static float Decremented(float value)
        {
            var temp = new Float32(value);

            // Decrementing the integer representation gives the previous float.
            temp._valueI--;
            return(temp._valueF);
        }