Procházet zdrojové kódy

Merge pull request #30 from keithdotpower/fix-div-operator

Fix for division operator, and added floor division operator
Swaroop C H před 9 roky
rodič
revize
21a5239cae
1 změnil soubory, kde provedl 6 přidání a 2 odebrání
  1. 6 2
      op_exp.md

+ 6 - 2
op_exp.md

@@ -38,8 +38,12 @@ Here is a quick overview of the available operators:
 
 - `/` (divide)
     - Divide x by y
-    - `13 / 3` gives `4`.
-    - `13.0 / 3` gives `4.333333333333333`
+    - `13 / 3` gives `4.333333333333333`
+
+- `//` (divide and floor)
+    - Divide x by y and round the answer _down_ to the nearest whole number
+    - `13 // 3` gives `4`
+    - `-13 // 3` gives `-5`
 
 - `%` (modulo)
     - Returns the remainder of the division