Re: Why a time of the real world must be galilean (space-contraction)

Liste des GroupesRevenir à fs maths 
Sujet : Re: Why a time of the real world must be galilean (space-contraction)
De : efji (at) *nospam* efi.efji (efji)
Groupes : fr.sci.maths
Date : 05. Jan 2025, 21:43:04
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vleqso$16eri$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12
User-Agent : Mozilla Thunderbird
Le 05/01/2025 à 21:27, Michel Talon a écrit :
Le 05/01/2025 à 12:00, robby a écrit :
   ('Carre de ', 10, ' donne ', '100', ' soit', 10, '+', 0, ' OK')
au lieu de   Carre de 10 donne 100 soit 10 + 0 OK ?
 Python est "orienté objet"  donc quand l'opérateur + reçoit pour arguments des chaînes de caractères, il les concatène, quand  il reçoit des nombres il les ajoute, etc.
Dans le programme qui est montré , i^2 est converti en "string", laquelle est coupée en deux par les trucs genre t[:m1]  et chaque moitié reconverti en int.
Evidemment ces manipulations sont extrêmement inefficaces, ce qui explique en partie la lenteur du programme ....
Il y a moyen de faire sans ce genre de conversions. Voir par exemple le post de Sam Devulder dans
Re: Le calcul de la racine carré... pour des nuls :)
le 10/11/2024 03:40
 
Absolument. C'est d'une inefficacité remarquable, il ne faut jamais faire ça. En utilisant la division entière et le modulo on écrit un programme qui va beaucoup plus vite.
--
F.J.

Date Sujet#  Auteur
16 Dec 24 * Re: Why a time of the real world must be galilean (space-contraction)16Richard Hachel
19 Dec 24 +- Re: Why a time of the real world must be galilean (space-contraction)1Python
5 Jan 25 `* Re: Why a time of the real world must be galilean (space-contraction)14Dominique
5 Jan 25  `* Re: Why a time of the real world must be galilean (space-contraction)13Dominique
5 Jan 25   `* Re: Why a time of the real world must be galilean (space-contraction)12Dominique
5 Jan 25    `* Re: Why a time of the real world must be galilean (space-contraction)11robby
5 Jan 25     +* Re: Why a time of the real world must be galilean (space-contraction)2Python
7 Jan 25     i`- Re: Why a time of the real world must be galilean (space-contraction)1robby
5 Jan 25     +- Re: Why a time of the real world must be galilean (space-contraction)1Thomas Alexandre
5 Jan 25     +* Re: Why a time of the real world must be galilean (space-contraction)3Dominique
5 Jan 25     i`* Re: Why a time of the real world must be galilean (space-contraction)2Python
6 Jan 25     i `- Re: Why a time of the real world must be galilean (space-contraction)1Dominique
5 Jan 25     `* Re: Why a time of the real world must be galilean (space-contraction)4Michel Talon
5 Jan 25      +* Re: Why a time of the real world must be galilean (space-contraction)2efji
6 Jan 25      i`- Re: Why a time of the real world must be galilean (space-contraction)1Dominique
7 Jan 25      `- Re: Why a time of the real world must be galilean (space-contraction)1robby

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal