Differences between revisions 1 and 2
Revision 1 as of 2008-04-21 13:21:33
Size: 594
Editor: NinaMaass
Comment:
Revision 2 as of 2008-04-21 13:24:57
Size: 665
Editor: NinaMaass
Comment:
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:
Numerischer Typ Speicherbelegung
float32 4 byte(s)
float64 8 byte(s)
float96 12 byte(s)
complex64 8 byte(s)
complex128 16 byte(s)
complex192 24 byte(s)
Numerischer Typ         Speicherbelegung

float32          4 byte(s)

float64          8 byte(s)

float96         12 byte(s)

complex64          8 byte(s)

complex128         16 byte(s)

complex192         24 byte(s)

   1 from scipy import *
   2 Float_str=['float32','float64','float96','complex64','complex128','complex192']
   3 Float=array([float32,float64,float96,complex64,complex128,complex192])
   4 print 'Numerischer Typ\tSpeicherbelegung'
   5 for k in range(Float.size):
   6         f=Float_str[k]
   7         a=Float[k](1)
   8         Speicher=a.nbytes
   9         print f,'\t',Speicher,'byte(s)'

Ausgabe:

Numerischer Typ Speicherbelegung

float32 4 byte(s)

float64 8 byte(s)

float96 12 byte(s)

complex64 8 byte(s)

complex128 16 byte(s)

complex192 24 byte(s)

LehreWiki: SiaExercisesLesson2LoesungNumpyFloat (last edited 2008-04-21 13:31:06 by NinaMaass)