diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-04-18 23:53:13 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-11-22 11:07:54 +0800 |
commit | 3d99e8279575c686bd48801c3c3bad2fde8a30c6 (patch) | |
tree | 1ac29613f64467de57f2c85e49175bf2c3928820 /docs/julia.rst | |
parent | 173bdb0df6ce338d2b6fff80877224a9cfdb3d68 (diff) | |
download | dexon-solidity-3d99e8279575c686bd48801c3c3bad2fde8a30c6.tar dexon-solidity-3d99e8279575c686bd48801c3c3bad2fde8a30c6.tar.gz dexon-solidity-3d99e8279575c686bd48801c3c3bad2fde8a30c6.tar.bz2 dexon-solidity-3d99e8279575c686bd48801c3c3bad2fde8a30c6.tar.lz dexon-solidity-3d99e8279575c686bd48801c3c3bad2fde8a30c6.tar.xz dexon-solidity-3d99e8279575c686bd48801c3c3bad2fde8a30c6.tar.zst dexon-solidity-3d99e8279575c686bd48801c3c3bad2fde8a30c6.zip |
Add types to the examples
Diffstat (limited to 'docs/julia.rst')
-rw-r--r-- | docs/julia.rst | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/docs/julia.rst b/docs/julia.rst index f1a6d8f8..42c8047e 100644 --- a/docs/julia.rst +++ b/docs/julia.rst @@ -30,16 +30,16 @@ and ``mod`` are available either natively or as functions and computes exponenti .. code:: { - function power(base, exponent) -> (result) + function power(base:u256, exponent:u256) -> (result:u256) { switch exponent - 0: { result := 1 } - 1: { result := base } + 0:u256: { result := 1:u256 } + 1:u256: { result := base } default: { - result := power(mul(base, base), div(exponent, 2)) - switch mod(exponent, 2) - 1: { result := mul(base, result) } + result := power(mul(base, base), div(exponent, 2:u256)) + switch mod(exponent, 2:u256) + 1:u256: { result := mul(base, result) } } } } @@ -51,10 +51,10 @@ and ``add`` to be available. .. code:: { - function power(base, exponent) -> (result) + function power(base:u256, exponent:u256) -> (result:u256) { - result := 1 - for { let i := 0 } lt(i, exponent) { i := add(i, 1) } + result := 1:u256 + for { let i := 0:u256 } lt(i, exponent) { i := add(i, 1:u256) } { result := mul(result, base) } |