Пример #1
0
        /// <summary>Converts the string representation of a number to a half-precision floating-point equivalent. Returns success.</summary>
        /// <param name="s">String representation of the number to convert.</param>
        /// <param name="style">Specifies the format of s.</param>
        /// <param name="provider">Culture-specific formatting information.</param>
        /// <param name="result">The Half instance to write to.</param>
        /// <returns>Success.</returns>
        public static bool TryParse(string s, System.Globalization.NumberStyles style, IFormatProvider provider, out Half result)
        {
            float f;
            bool  b = SingleExtensions.TryParse(s, style, provider, out f);

            result = (Half)f;
            return(b);
        }
Пример #2
0
        /// <summary>Converts the string representation of a number to a half-precision floating-point equivalent. Returns success.</summary>
        /// <param name="s">String representation of the number to convert.</param>
        /// <param name="result">The Half instance to write to.</param>
        /// <returns>Success.</returns>
        public static bool TryParse(string s, out Half result)
        {
            float f;
            bool  b = SingleExtensions.TryParse(s, out f);

            result = (Half)f;
            return(b);
        }