Add new python note about float round
This commit is contained in:
26
20220206220528-arrondir_les_flottants_en_python.org
Normal file
26
20220206220528-arrondir_les_flottants_en_python.org
Normal 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]]
|
Reference in New Issue
Block a user