taille d'un flottant

taille d'un flottant - Python - Programmation

Marsh Posté le 15-06-2006 à 10:34:59    

bonjour,
j'ai besoin de faire un calcul utilisant de tableaux assez gros avec des fottants dedans.
je pars donc d'un tableau de [[0.]*longueur]*largeur
mais rapidement j arrive a un tableau assez gros avec des nombres en 10^-42  :(  
Or je n'ai pas besoin de cette precision et ca prend un temps fou a calculer
c'est possible d'utiliser des flottants plus petit? genre limiter la precision a un certain nombre de chiffre apres la virgule?

Reply

Marsh Posté le 15-06-2006 à 10:34:59   

Reply

Marsh Posté le 15-06-2006 à 15:42:48    


Ton truc est buggé, direct [:dawa]


Message édité par masklinn le 15-06-2006 à 16:52:49

---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r
Reply

Marsh Posté le 15-06-2006 à 16:28:55    

c'est toi qui a rajouté le dernier crochet  :heink:

Reply

Marsh Posté le 15-06-2006 à 16:35:21    

utilise des implémentations efficaces pour matrice creuse, sinon achete de la ram

Reply

Marsh Posté le 15-06-2006 à 16:53:52    


c'était une erreur, mais ça ne rend pas ton initialisation moins buggée [:dawa]
 
Fais le test toi même:
 

Code :
  1. >> mat = [[None]*10]*10
  2. >> mat [0][0] = 3
  3. >> print mat


J'pense que tu vas avoir une surprise [:grinking]


Message édité par masklinn le 15-06-2006 à 16:54:08

---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r
Reply

Marsh Posté le 15-06-2006 à 17:13:50    

ah oui merde  :??:  
merci  :jap:

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed