aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-30 04:38:54 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-09-04 22:57:05 +0800
commit435eeec5e15d94ffc2dff01dd09c8c92c697dc4e (patch)
tree07a83cfc5496566c5310bd87db5df221397ecdf0
parent76bd8c57694b9335dc5ce29204f57825b4a565eb (diff)
downloaddexon-solidity-435eeec5e15d94ffc2dff01dd09c8c92c697dc4e.tar
dexon-solidity-435eeec5e15d94ffc2dff01dd09c8c92c697dc4e.tar.gz
dexon-solidity-435eeec5e15d94ffc2dff01dd09c8c92c697dc4e.tar.bz2
dexon-solidity-435eeec5e15d94ffc2dff01dd09c8c92c697dc4e.tar.lz
dexon-solidity-435eeec5e15d94ffc2dff01dd09c8c92c697dc4e.tar.xz
dexon-solidity-435eeec5e15d94ffc2dff01dd09c8c92c697dc4e.tar.zst
dexon-solidity-435eeec5e15d94ffc2dff01dd09c8c92c697dc4e.zip
Explain the difference between floating and fixed point
-rw-r--r--docs/frequently-asked-questions.rst5
-rw-r--r--docs/types.rst6
2 files changed, 6 insertions, 5 deletions
diff --git a/docs/frequently-asked-questions.rst b/docs/frequently-asked-questions.rst
index 5f1a981e..d9a68ed1 100644
--- a/docs/frequently-asked-questions.rst
+++ b/docs/frequently-asked-questions.rst
@@ -103,11 +103,6 @@ This is a limitation of the EVM and will be solved with the next protocol update
Returning variably-sized data as part of an external transaction or call is fine.
-How do you represent ``double``/``float`` in Solidity?
-======================================================
-
-This is not yet possible.
-
Is it possible to in-line initialize an array like so: ``string[] myarray = ["a", "b"];``
=========================================================================================
diff --git a/docs/types.rst b/docs/types.rst
index d1b5a3f1..71a4b0e6 100644
--- a/docs/types.rst
+++ b/docs/types.rst
@@ -88,6 +88,12 @@ Operators:
* Comparisons: ``<=``, ``<``, ``==``, ``!=``, ``>=``, ``>`` (evaluate to ``bool``)
* Arithmetic operators: ``+``, ``-``, unary ``-``, unary ``+``, ``*``, ``/``, ``%`` (remainder)
+.. note::
+ The main difference between floating point (``float`` and ``double`` in many languages, more precisely IEEE 754 numbers) and fixed point numbers is
+ that the number of bits used for the integer and the fractional part (the part after the decimal dot) is flexible in the former, while it is strictly
+ defined in the latter. Generally, in floating point almost the entire space is used to represent the number, while only a small number of bits define
+ where the decimal point is.
+
.. index:: address, balance, send, call, callcode, delegatecall, transfer
.. _address: