#59 Binary Constant Notation

closed
None
3
2008-09-14
2004-01-22
No

I think it would be great to be able to write binary
constants like this:

byte flags= 0b11001010;

Discussion

  • Patrik Spieß

    Patrik Spieß - 2004-01-22
    • priority: 5 --> 3
     
  • Bernhard Held

    Bernhard Held - 2004-01-22

    Logged In: YES
    user_id=203539

    #define BIN(x) \ ( ((0x##x##L & 0x00000001L) ? 0x01 : 0) \ | ((0x##x##L & 0x00000010L) ? 0x02 : 0) \ | ((0x##x##L & 0x00000100L) ? 0x04 : 0) \ | ((0x##x##L & 0x00001000L) ? 0x08 : 0) \ | ((0x##x##L & 0x00010000L) ? 0x10 : 0) \ | ((0x##x##L & 0x00100000L) ? 0x20 : 0) \ | ((0x##x##L & 0x01000000L) ? 0x40 : 0) \ | ((0x##x##L & 0x10000000L) ? 0x80 : 0))

    T2CON = BIN(00110100);

     
  • Borut Ražem

    Borut Ražem - 2008-09-14

    Implemented in svn revision #5205.

    Borut

     
  • Borut Ražem

    Borut Ražem - 2008-09-14
    • assigned_to: nobody --> borutr
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks