Thread overview
integer literals - in binary
Feb 03, 2004
imr1984
Feb 03, 2004
Vathix
Feb 03, 2004
Stephan Wienczny
Feb 03, 2004
Matthew
February 03, 2004
ok so all C based languages can do this:

int x = 0xFF; //255

what about this:

int x = 0b11111111; //255

this would be very useful especially for defining flags


February 03, 2004
> int x = 0b11111111; //255
> 
> this would be very useful especially for defining flags
>

It's supported. Give it a try.


-- 
Christopher E. Miller
www.dprogramming.com
February 03, 2004
imr1984 wrote:
> ok so all C based languages can do this:
> 
> int x = 0xFF; //255
> 
> what about this:
> 
> int x = 0b11111111; //255
> 
> this would be very useful especially for defining flags
> 
> 


Have a look at

http://digitalmars.com/d/lex.html

There look at Integer Literals -> binary
D supports exactly the notation you suggest...

Stephan

February 03, 2004
AFAIUI, D already supports this, although I do not know the precise syntax

"imr1984" <imr1984_member@pathlink.com> wrote in message news:bvo5a9$2mqs$1@digitaldaemon.com...
> ok so all C based languages can do this:
>
> int x = 0xFF; //255
>
> what about this:
>
> int x = 0b11111111; //255
>
> this would be very useful especially for defining flags
>
>