Struct MessageFieldValue
One message field's value, widened without loss: every type up to 32 bits and both floating types as a double (exact — a float widens and narrows back to the same bits), a 64-bit integer as its bits.
public readonly struct MessageFieldValue
- Inherited Members
Properties
Integer64Bits
A 64-bit integer's bits (two's complement for a signed one); 0 for a number.
public ulong Integer64Bits { get; }
Property Value
IsInteger64
Whether the value is a 64-bit integer.
public bool IsInteger64 { get; }
Property Value
Number
The value as a number: exact for every type but a 64-bit integer, which rounds as a (double) cast does.
public double Number { get; }
Property Value
Methods
Of(double)
A value of 32 bits or fewer, or a floating one.
public static MessageFieldValue Of(double value)
Parameters
valuedoubleThe value.
Returns
- MessageFieldValue
The field value.
Of(long)
A signed 64-bit value.
public static MessageFieldValue Of(long value)
Parameters
valuelongThe value.
Returns
- MessageFieldValue
The field value.
Of(ulong)
An unsigned 64-bit value.
public static MessageFieldValue Of(ulong value)
Parameters
valueulongThe value.
Returns
- MessageFieldValue
The field value.