From d31eec13274d150d2881a5bbeaa55235e7ab47f6 Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Thu, 26 Dec 2019 13:29:22 +0100 Subject: [PATCH] fix "math-numbers-tez.md" --- .../docs/language-basics/math-numbers-tez.md | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/gitlab-pages/docs/language-basics/math-numbers-tez.md b/gitlab-pages/docs/language-basics/math-numbers-tez.md index 77db6bef3..1609679e8 100644 --- a/gitlab-pages/docs/language-basics/math-numbers-tez.md +++ b/gitlab-pages/docs/language-basics/math-numbers-tez.md @@ -14,7 +14,7 @@ In the following example you can find a series of arithmetic operations, includi -```pascaligo +```pascaligo group=a // int + int produces int const a: int = 5 + 10; // nat + int produces int @@ -38,7 +38,7 @@ const g: int = 1_000_000; -```cameligo +```cameligo group=a // int + int produces int let a: int = 5 + 10 // nat + int produces int @@ -62,19 +62,19 @@ let g: int = 1_000_000 -```reasonligo -/* int + int produces int */ +```reasonligo group=a +(* int + int produces int *) let a: int = 5 + 10; -/* nat + int produces int */ +(* nat + int produces int *) let b: int = 5n + 10; -/* tez + tez produces tez */ +(* tez + tez produces tez *) let c: tez = 5mutez + 10mutez; -/* you can't add tez + int or tez + nat, this won't compile */ -/* let d: tez = 5mutez + 10n; */ -/* two nats produce a nat */ +(* you can't add tez + int or tez + nat, this won't compile: + let d: tez = 5mutez + 10n; *) +(* two nats produce a nat *) let e: nat = 5n + 10n; -/* nat + int produces an int, this won't compile */ -/* let f: nat = 5n + 10; */ +(* nat + int produces an int, this won't compile: +let f: nat = 5n + 10; *) let g: int = 1_000_000; ``` @@ -94,33 +94,33 @@ The simpliest substraction looks like this: -```pascaligo +```pascaligo group=b const a: int = 5 - 10; // substraction of two nats, yields an int const b: int = 5n - 2n; // won't compile, result is an int, not a nat // const c: nat = 5n - 2n; -const d: tez = 5mutez - 1mt; +const d: tez = 5mutez - 1mutez; ``` -```cameligo +```cameligo group=b let a: int = 5 - 10 // substraction of two nats, yields an int let b: int = 5n - 2n // won't compile, result is an int, not a nat // const c: nat = 5n - 2n -let d: tez = 5mutez - 1mt +let d: tez = 5mutez - 1mutez ``` -```reasonligo +```reasonligo group=b let a: int = 5 - 10; -/* substraction of two nats, yields an int */ +(* substraction of two nats, yields an int *) let b: int = 5n - 2n; -/* won't compile, result is an int, not a nat */ -/* let c: nat = 5n - 2n; */ -let d: tez = 5mutez - 1mt; +(* won't compile, result is an int, not a nat *) +(* let c: nat = 5n - 2n; *) +let d: tez = 5mutez - 1mutez; ``` @@ -133,7 +133,7 @@ You can multiply values of the same type, such as: -```pascaligo +```pascaligo group=c const a: int = 5 * 5; const b: nat = 5n * 5n; // you can also multiply `nat` and `tez` @@ -141,7 +141,7 @@ const c: tez = 5n * 5mutez; ``` -```cameligo +```cameligo group=c let a: int = 5 * 5 let b: nat = 5n * 5n // you can also multiply `nat` and `tez` @@ -149,10 +149,10 @@ let c: tez = 5n * 5mutez ``` -```reasonligo +```reasonligo group=c let a: int = 5 * 5; let b: nat = 5n * 5n; -/* you can also multiply `nat` and `tez` */ +(* you can also multiply `nat` and `tez` *) let c: tez = 5n * 5mutez; ``` @@ -167,21 +167,21 @@ In LIGO you can divide `int`, `nat`, and `tez`. Here's how: -```pascaligo +```pascaligo group=d const a: int = 10 / 3; const b: nat = 10n / 3n; const c: nat = 10mutez / 3mutez; ``` -```cameligo +```cameligo group=d let a: int = 10 / 3 let b: nat = 10n / 3n let c: nat = 10mutez / 3mutez ``` -```reasonligo +```reasonligo group=d let a: int = 10 / 3; let b: nat = 10n / 3n; let c: nat = 10mutez / 3mutez; @@ -195,13 +195,13 @@ You can *cast* an `int` to a `nat` and vice versa, here's how: -```pascaligo +```pascaligo group=e const a: int = int(1n); const b: nat = abs(1); ``` -```reasonligo +```reasonligo group=e let a: int = int(1n); let b: nat = abs(1); ```