Typo in Types page

Philpax phillip at philliplarkson.com
Sun Apr 6 02:47:03 PDT 2014


On Sunday, 6 April 2014 at 09:30:47 UTC, Gustavo wrote:
> In the page http://dlang.org/type.html I believe there is a 
> typo stating that bool is 1 byte instead of 1 bit.

While a boolean is by definition a single bit, it is represented 
by programming languages as a byte for various reasons (including 
performance, data layout, and interfacing). You can verify that 
this is the case: http://dpaste.dzfl.pl/8129625be797

As far as I know, this is true for most, if not all, native 
programming languages. To actually store a value as a single bit, 
you will have to use bit manipulation.


More information about the Digitalmars-d mailing list