Re: complex numbers
It's me wrote: > I am very happy that Python included *native* complex number support. And I have always been happy that FORTRAN supports them. I really like Python's notion of having just one data type: the duck. So have you considered using Python for your problem? -- Just because I've written it doesn't mean that either you or I have to believe it. -- http://mail.python.org/mailman/listinfo/python-list
Re: turn text lines into a list
Gunnar Hjalmarsson wrote: > >> @corenames=qw( >> rb_basic_islamic >> sq1_pentagonTile >> sq_arc501Tile >> sq_arc503Tile >> ); > > > Impractical to mix code and data, isn't it? Obviously not impractical, given he did it quite easily and succinctly. > chomp( my @corenames = ); > > __DATA__ > rb_basic_islamic > sq1_pentagonTile > sq_arc501Tile > sq_arc503Tile Not so easy when you have multiple variables to set. And the original version was transparent in what it was doing - your version is not. -- Just because I've written it doesn't mean that either you or I have to believe it. -- http://mail.python.org/mailman/listinfo/python-list
Re: sizeof(struct timeval)
Tony Houghton wrote: > > How safe would I be assuming that > > sizeof(struct timeval) == 2 * sizeof(long) > > is always true on Linux on different architectures? Based on what I was looking at today (well, yesterday now), you might be wrong. I do know that the size of a struct utmp differs between a Linux Itanium system and a Linux x86_64 system, and I seem to recall it migh be related to timeval. I could be wrong - I wasn't interested in the timeval part - but this part of the bits/utmp.h include file indicates the issue: /* The ut_session and ut_tv fields must be the same size when compiled 32- and 64-bit. This allows data files and shared memory to be shared between 32- and 64-bit applications. */ #if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32 int32_t ut_session; /* Session ID, used for windowing. */ struct { int32_t tv_sec; /* Seconds. */ int32_t tv_usec;/* Microseconds. */ } ut_tv; /* Time entry was made. */ #else long int ut_session; /* Session ID, used for windowing. */ struct timeval ut_tv; /* Time entry was made. */ #endif -- Just because I've written it doesn't mean that either you or I have to believe it. -- http://mail.python.org/mailman/listinfo/python-list
Re: sizeof(struct timeval)
Big and Blue wrote: > Tony Houghton wrote: >> >> How safe would I be assuming that >> sizeof(struct timeval) == 2 * sizeof(long) >> >> is always true on Linux on different architectures? > >Based on what I was looking at today (well, yesterday now), you might > be wrong. However, it looks as though I was wrong: linux/time.h: struct timeval { time_t tv_sec; /* seconds */ suseconds_t tv_usec;/* microseconds */ }; time.h: typedef __time_t time_t; sys/time.h: typedef __suseconds_t suseconds_t; bits/types.h: __STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */ ... __STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds */ bits/typesizes.h: #define __TIME_T_TYPE __SLONGWORD_TYPE ... #define __SUSECONDS_T_TYPE __SLONGWORD_TYPE bits/types.h: #define __SLONGWORD_TYPElong int -- Just because I've written it doesn't mean that either you or I have to believe it. -- http://mail.python.org/mailman/listinfo/python-list