Hi! I never before use rexx built-in binary function.
Today I try to use built-in function BITOR and see
say bitor(8,4) / == '<' /
say x2b(8) / == '1000' /
say x2b(4) / == '0100' /
say bitor('1000'b,'0100'b) / == '0C'x as one char /
say bitor(x2b(8),x2b(4)) / == '1100'b /
It's drive me crazy.
I don't understand why bitor(8,4) returns char '<'
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi! I never before use rexx built-in binary function.
Today I try to use built-in function BITOR and see
say bitor(8,4) / == '<' /
say x2b(8) / == '1000' /
say x2b(4) / == '0100' /
say bitor('1000'b,'0100'b) / == '0C'x as one char /
say bitor(x2b(8),x2b(4)) / == '1100'b /
It's drive me crazy.
I don't understand why bitor(8,4) returns char '<'
You are bitoring the STRING '8' with the STRING '4'
You are using ascii so
'8' is '38'x = '00111000'b
'4' is '34'x = '00110100'b
ORing them gives '00111100'b = '3c'x which in ascii is the character '<'
Hi! I never before use rexx built-in binary function.
Today I try to use built-in function BITOR and see
say bitor(8,4) / == '<' /
say x2b(8) / == '1000' /
say x2b(4) / == '0100' /
say bitor('1000'b,'0100'b) / == '0C'x as one char /
say bitor(x2b(8),x2b(4)) / == '1100'b /
It's drive me crazy.
I don't understand why bitor(8,4) returns char '<'
Hi! I never before use rexx built-in binary function.
Today I try to use built-in function BITOR and see
say bitor(8,4) / == '<' /
say x2b(8) / == '1000' /
say x2b(4) / == '0100' /
say bitor('1000'b,'0100'b) / == '0C'x as one char /
say bitor(x2b(8),x2b(4)) / == '1100'b /
It's drive me crazy.
I don't understand why bitor(8,4) returns char '<'
The bit functions operate on characters. In ASCII, 8 is '38'x and 4 is
'34'x. Oring those bits together produces '3c'x, which is the character
'<'.
Rick
On Fri, Apr 3, 2015 at 8:31 AM, Sergey hogges@users.sf.net wrote:
Hi Sergey
You are bitoring the STRING '8' with the STRING '4'
You are using ascii so
'8' is '38'x = '00111000'b
'4' is '34'x = '00110100'b
ORing them gives '00111100'b = '3c'x which in ascii is the character '<'
hope that helps,
Jon
On 3 April 2015 at 13:31, Sergey hogges@users.sf.net wrote:
Thank You very much.