aboutsummaryrefslogtreecommitdiffstats
path: root/docs/types.rst
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2016-11-25 17:54:40 +0800
committerYoichi Hirai <i@yoichihirai.com>2016-11-25 17:54:40 +0800
commita747f1d2c32c691b00f3b24fead8436195eb555e (patch)
treeeb01429f0c23fca815aa1b7e0669b07c4d0063e1 /docs/types.rst
parent76dd85edfacb1909a7de5807d369e69c8558deac (diff)
downloaddexon-solidity-a747f1d2c32c691b00f3b24fead8436195eb555e.tar
dexon-solidity-a747f1d2c32c691b00f3b24fead8436195eb555e.tar.gz
dexon-solidity-a747f1d2c32c691b00f3b24fead8436195eb555e.tar.bz2
dexon-solidity-a747f1d2c32c691b00f3b24fead8436195eb555e.tar.lz
dexon-solidity-a747f1d2c32c691b00f3b24fead8436195eb555e.tar.xz
dexon-solidity-a747f1d2c32c691b00f3b24fead8436195eb555e.tar.zst
dexon-solidity-a747f1d2c32c691b00f3b24fead8436195eb555e.zip
docs: clarify how many number literal types are there
Diffstat (limited to 'docs/types.rst')
-rw-r--r--docs/types.rst10
1 files changed, 7 insertions, 3 deletions
diff --git a/docs/types.rst b/docs/types.rst
index 85309f60..83b0a098 100644
--- a/docs/types.rst
+++ b/docs/types.rst
@@ -169,9 +169,13 @@ Fixed Point Numbers
Rational and Integer Literals
-----------------------------
-Integer literals and rational number literals belong to a special type.
-The number literal type contains not just single literals
-but all number literal expressions (i.e. the expressions that contain only number literals and operators).
+Solidity has a number literal type for each rational number.
+Integer literals and rational number literals belong to number literal types.
+Moreover, all number literal expressions (i.e. the expressions that
+contain only number literals and operators) belong to number literal
+types. So the number literal expressions `1 + 2` and `2 + 1` both
+belong to the same number literal type for the rational number three.
+
Number literal expressions retain arbitrary precision until they are converted to a non-literal type (i.e. by
using them together with a non-literal expression).
This means that computations do not overflow and divisions do not truncate