Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

binary

Name: Anonymous 2012-02-10 14:08

Why is it that languages don't support binary declaration?
Ex:int haxmyanus =1001b

Instead I am stuck with converting to hex....

Name: sage 2012-02-10 14:12

But they do, silly!
#b1001
See?

Name: Anonymous 2012-02-10 14:12

0b1001

Name: Anonymous 2012-02-10 14:21

C doesn't support binary because octal and hex are more concise ways of saying the same thing. Plenty of other languages such as Perl, Python and Ruby do support binary literals.

Name: Anonymous 2012-02-10 14:44

You know what really rustles my jimmies? When an assembler doesn't support direct binary literals.

Name: Anonymous 2012-02-10 15:31

You know what really sucks my dick? You're mom.

Name: Anonymous 2012-02-10 15:51

>>5
db

Name: Anonymous 2012-02-10 15:58

D supports binary literals.

www.d-programming-language.org

Name: Anonymous 2012-02-10 17:54

Many C compilers targeting smaller embedded things usually extend the language with binary literals and sometimes bit flip statements. Useful when you have 40 bytes of RAM (they call them ``General Purpose Registers'' though) to work with.

Name: Anonymous 2012-02-17 1:22

>>11
nice dubs bro

Name: Anonymous 2012-02-17 1:58

I've done this before:


#define BINARY_BYTE(b7,b6,b5,b4,b3,b2,b1,b0) \
 ( \
  ((b7)<<7) | \
  ((b6)<<6) | \
  ((b5)<<5) | \
  ((b4)<<4) | \
  ((b3)<<3) | \
  ((b2)<<2) | \
  ((b1)<<1) | \
  ((b0)<<0) \
 )


>>10
thanks man.

Name: Anonymous 2012-02-17 2:09

>>6
You know what really sucks my dick?
No, tell me.
You're mom.
No, I'm a father.

But please give me the answer!

Name: Anonymous 2012-02-17 2:20

>>6
>You're mom

My mom is dead, your little sister has a nice tight pooper, and gcc supports binary declaration.

Name: Anonymous 2012-02-17 4:55

>>13
Please go!

Don't change these.
Name: Email:
Entire Thread Thread List