Example #1
0
        public void SetValue(double value)
        {
#if USE_HEX_FLOAT
            // It is more precise technic but output looks vague and less readable
            ulong hex = BitConverterExtensions.ToUInt64(value);
            m_string     = $"0x{hex.ToHexString()}({value.ToString(CultureInfo.InvariantCulture)})";
            m_objectType = ScalarType.String;
#else
            m_value      = BitConverterExtensions.ToUInt64(value);
            m_objectType = ScalarType.Double;
#endif
        }
        public static string ToHexString(this double _this)
        {
            ulong value = BitConverterExtensions.ToUInt64(_this);

            return(ToHexString(value));
        }
Example #3
0
 public static Emitter WriteHex(this Emitter _this, double value)
 {
     return(WriteHex(_this, BitConverterExtensions.ToUInt64(value)));
 }