Path: ...!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Dominique Newsgroups: fr.comp.lang.python Subject: Re: Affichage en notation scientifique. Date: Wed, 14 Sep 2022 18:33:07 +0200 Organization: A noiseless patient Spider Lines: 18 Message-ID: References: <87a672xbrj.fsf@universite-de-strasbourg.fr.invalid> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Wed, 14 Sep 2022 16:33:07 -0000 (UTC) Injection-Info: reader01.eternal-september.org; posting-host="8894558db0d5460c4ced3f0ce4a43f4d"; logging-data="3194396"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4IGCQYwKd7rxC4K+TqL7bLy6p+h3Zcro=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Cancel-Lock: sha1:koMeb7uj2qr00Ftdn7Kyu2Hu7EU= In-Reply-To: Content-Language: fr Bytes: 1927 Le 14/09/2022 à 18:10, Stefan Ram a écrit : > ram@zedat.fu-berlin.de (Stefan Ram) writes: > > (Mais on peut probablement aussi utiliser la longueur du > nombre entier comme chaîne de caractères pour calculer le > logarithme décimal.) J'avais pensé à cette méthode... J'ai préféré l'approche arithmétique, mais vous avez raison, l'anomalie (14) que vous soulevez dans le précédent post est ennuyeuse. Je peux la contourner avec un len(str(num)) et j'aurai mon exposant + 1. C'est sans doute l'option que je vais adopter. Merci pour le tuyau, Dominique