[bind10-dev] numeric/integer size on CC channel

fujiwara at jprs.co.jp fujiwara at jprs.co.jp
Thu Jun 20 08:34:03 UTC 2013


Background

  Number value on JSON is 64bit IEEE 754 value == double.

  type of intElement() on C++ is "long int".
  size of "long int" is 32bit or 64bit, different on systems.

  Python3 can handle unlimited size integer values.

  Current type of statistics data is "long int" 32/64bit signed integer.

  We need to check type of Element before using Element value.

Question

  1. Do all systems have int64_t and uint64_t (64bit integers) ?

  2. Is there performance problem to use int64_t ?

Proposal

  1. Change type of intElement as int64_t
  2. Add uint64Element which holds uint64_t value.
  3. Prepare automatic type conversion among intElement, uint64Element and
     doubleElement.
     If converted type cannot carry the value, exceptions will occur.

  I implemented it in trac2986test branch.
  If the proposal will be accepted, I will make new tickets.

Regards,

--
Kazunori Fujiwara, JPRS <fujiwara at jprs.co.jp>


More information about the bind10-dev mailing list