code_junkie

What's the best way to represent System.Decimal in Protocol Buffers?

Nov 13th, 2011
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. message Decimal {
  2. optional uint64 lo = 1; // the first 64 bits of the underlying value
  3. optional uint32 hi = 2; // the last 32 bis of the underlying value
  4. optional sint32 signScale = 3; // the number of decimal digits, and the sign
  5. }
  6.  
  7. message Decimal {
  8.  
  9. // 96-bit mantissa broken into two chunks
  10. optional uint64 mantissa_msb = 1;
  11. optional uint32 mantissa_lsb = 2;
  12.  
  13. required sint32 exponent_and_sign = 3;
  14. }
Add Comment
Please, Sign In to add comment