Reading and writing GSL random number generators

Martin Jansche jansche@ling.ohio-state.edu
Wed May 28 21:24:00 GMT 2003


On Wed, 28 May 2003, Olaf Lenz wrote:

> What type is best to use when you really need one byte (i.e. 8 bit)?

In C99 (ISO 9899:1999) you can #include <stdint.h> and use int8_t
(signed) or uint8_t (unsigned), which, if they exist, are exactly 8
bits wide;  int_least8_t is required to exist and is at least 8 bits
wide.  However, this may not be a good move at this point, as C99
isn't widely supported yet.

> Is and will char always be 8 bit?

Doesn't look like it.  Quoting the C99 standard:  "An object declared
as type char is large enough to store any member of the basic
execution character set." (6.2.5)  And: "The representation of each
member of the [...] execution basic character [set] shall fit in a
byte." (5.2.1)  So char would have to be at least 8 bits wide, but
could be wider.

- martin



More information about the Gsl-discuss mailing list