Add new python note about float round

This commit is contained in:
2022-02-11 17:07:14 +01:00
parent 2e5bf7d1a7
commit c330a3991d
2 changed files with 28 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
:PROPERTIES:
:ID: f7c05933-90e6-4a9c-acd5-1f0baf62f07f
:mtime: 20220207072847
:ctime: 20220206220528
:END:
#+title: Arrondir les flottants en python
#+filetags: :Python:
* Arrondir un nombre à l'entier inférieur
#+BEGIN_SRC python :results output
print(22 // 5)
#+END_SRC
#+RESULTS:
: 4
* Arrondir un noombre à l'entier supérieur
#+BEGIN_SRC python :results output
print(22 // -5 * -1)
#+END_SRC
#+RESULTS:
: 5
* Références
* [[https://www.delftstack.com/fr/howto/python/python-round-up/][Arrondir un nombre en Python]]