You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 
 

63 lines
776 B

  1. Maths simples
  2. =============
  3. Opérations avec des entiers
  4. ---------------------------
  5. .. code-block:: python
  6. >>> 1
  7. 1
  8. >>> 2
  9. 2
  10. >>> 1 + 2
  11. 3
  12. >>> 2 * 3
  13. 6
  14. Opérations avec des flottants
  15. -----------------------------
  16. C'est le ``.`` qui fait le flottant
  17. .. code-block:: python
  18. >>> 0.5
  19. 0.5
  20. >>> 0.5 + 0.2
  21. 0.7
  22. >>> 10 / 3
  23. 3.3333333333333335
  24. *Note: les flottants sont imprécis*
  25. Division entières et modulo
  26. ---------------------------
  27. .. code-block:: python
  28. >>> 14 // 3
  29. 4
  30. >>> 14 % 3
  31. 2
  32. *Le `%` n'a rien à voir avec un pourcentage!*
  33. Priorité des opérations
  34. ------------------------
  35. .. code-block:: python
  36. >>> 1 + 2 * 3
  37. 7
  38. >>> (1 + 2) * 3
  39. 9
  40. *Les parenthèses permettent de grouper les expressions*