From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 109d8a,232e89dd4cc3c154 X-Google-NewGroupId: yes X-Google-Thread: 1014db,232e89dd4cc3c154 X-Google-NewGroupId: yes X-Google-Thread: 1094ba,232e89dd4cc3c154 X-Google-NewGroupId: yes X-Google-Thread: 101deb,dea70f96af442ea2 X-Google-NewGroupId: yes X-Google-Thread: 103376,232e89dd4cc3c154 X-Google-NewGroupId: yes X-Google-Attributes: gid9ef9b79ae9,gid4516fb5702,gid8d3408f8c3,gidbda4de328f,gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: sci.math,comp.lang.c,comp.lang.fortran,comp.lang.pl1,comp.lang.ada Subject: Re: KISS4691, a potentially top-ranked RNG. Date: Fri, 29 Apr 2011 08:13:23 -0700 Organization: None to speak of Message-ID: References: <4dae2a4b$0$55577$c30e37c6@exi-reader.telstra.net> <4db90113$0$77724$c30e37c6@exi-reader.telstra.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx01.eternal-september.org; posting-host="mytEQcPL+ceHcrnNa7VoaQ"; logging-data="6896"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+KFts5sDMC404ukba7SrfX" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:/T3nJeidQEuSYwBu5/Ua0Ia2nlA= sha1:qttrD1urfqdln6/ygl5R5APTXG8= Xref: g2news1.google.com sci.math:217132 comp.lang.c:115359 comp.lang.fortran:38998 comp.lang.pl1:2312 comp.lang.ada:19089 Date: 2011-04-29T08:13:23-07:00 List-Id: glen herrmannsfeldt writes: > In comp.lang.fortran David Bernier wrote: [...] >> AFAIK, sizeof(unsigned long) can be relied upon to give the size >> in 8-bit bytes of a C "unsigned long". > > No. You need CHAR_BIT to tell how many bits are in a char. > It has been known to get to 64 on word addressed 64 bit machines. > It must be at least 8, but can be more. Certainly CHAR_BIT *could* be 64 (or even more), but I've never heard of a 64-bit system with CHAR_BIT==64. Such an implementation would have trouble dealing with octet-oriented data from other systems. Some DSPs (digital signal processors) do have CHAR_BIT > 8. There have been systems with, for example, 9-bit bytes, but they had pretty much become obsolete by the time C was standardized. C defines two kinds of implementations, hosted and freestanding. Hosted implementations must support the full standard library (stdio and so forth); freestanding implementations are typically for systems where the program doesn't run under an operating system, such as embedded systems and OS kernels. I've never heard of a hosted implementation with CHAR_BIT > 8. Do you know of such a system? -- Keith Thompson (The_Other_Keith) kst-u@mib.org Nokia "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"