This repository has been archived by the owner on Sep 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP][Docs] Add documentation for ENI types.
- Loading branch information
Yi Huang
committed
Sep 7, 2018
1 parent
d2b0c86
commit 81c8b78
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This section does not exist yet. `(´-ι_-\`)` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
============= | ||
Documentation | ||
============= | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ Contents | |
|
||
getting-started | ||
developer-guide | ||
documentation | ||
contributing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
===== | ||
Types | ||
===== | ||
|
||
ENI Types | ||
--------- | ||
|
||
.. _types-eni-int: | ||
|
||
ENI Integers | ||
```````````` | ||
|
||
All integer types in ENI is implemented using `boost::multiprecision::number <boostnumber_>`__. | ||
Some of them are aliases for types predefined in `boost::multiprecision::cpp_int <boostcppint_>`__. | ||
|
||
+---------------+-------------+--------+------------------------------+ | ||
| Integer Type | Size (bits) | Signed | Note | | ||
+===============+=============+========+------------------------------+ | ||
| ``eni::s256`` | 256 | ✔ | | | ||
+---------------+-------------+--------+------------------------------+ | ||
| ``eni::Int`` | 256 | ✔ | Alias for ``eni::s256``. | | ||
+---------------+-------------+--------+------------------------------+ | ||
| ``eni::u256`` | 256 | ✘ | | | ||
+---------------+-------------+--------+------------------------------+ | ||
| ``eni::u160`` | 160 | ✘ | Size of an Ethereum address. | | ||
+---------------+-------------+--------+------------------------------+ | ||
| ``eni::u128`` | 128 | ✘ | | | ||
+---------------+-------------+--------+------------------------------+ | ||
| ``eni::u64`` | 64 | ✘ | | | ||
+---------------+-------------+--------+------------------------------+ | ||
| ``eni::UInt`` | 256 | ✘ | Alias for ``eni::u256``. | | ||
+---------------+-------------+--------+------------------------------+ | ||
|
||
Operations on ENI Integers | ||
'''''''''''''''''''''''''' | ||
|
||
See `the documentation for boost::multiprecision::number <boostnumber_>`__ for | ||
supported operations. | ||
|
||
You may use `boost::lexical_cast <boostlexcast_>`__ to convert ENI integers to strings. | ||
|
||
.. _boostnumber: https://www.boost.org/doc/libs/1_58_0/libs/multiprecision/doc/html/boost_multiprecision/ref/number.html | ||
.. _boostcppint: https://www.boost.org/doc/libs/1_58_0/libs/multiprecision/doc/html/boost_multiprecision/tut/ints/cpp_int.html | ||
|
||
.. _boostlexcast: https://www.boost.org/doc/libs/1_58_0/doc/html/boost_lexical_cast.html | ||
|
||
Suggested Use of ENI Integers | ||
''''''''''''''''''''''''''''' | ||
|
||
.. include:: 404.rst | ||
|
||
.. _types-eni-bool: | ||
|
||
ENI Boolean | ||
``````````` | ||
|
||
``eni::Bool`` is an alias for C++ ``bool``. | ||
|
||
.. _types-eni-addr: | ||
|
||
ENI Address | ||
``````````` | ||
|
||
``eni::Address`` is an alias for ``eni::u160`` (20 bytes, size of an Ethereum address). | ||
|
||
.. _types-json: | ||
|
||
JSON Types | ||
---------- | ||
|
||
.. include:: 404.rst |