RE: BUG in or_bits
- Posted by Brian Broker <bkb at cnw.com> Jun 04, 2001
- 388 views
Can it be a bug if it's documented? >From the reference manual: "Results are treated as signed numbers. They will be negative when the highest-order bit is 1." constant mask = #FFFF0000 constant result = or_bits( mask, 0 ) -- it all depends on how you'd like to represent it... printf(1,"or_bits(#FFFF0000,0) = %d = 0x%x\n", {result,result} ) -- Brian Bernie Ryan wrote: > > There is a bug in or_bits() results, here is the simplest example > I can use to demonstrate this. Try running this code. > OR bits should return unsigned results. > > -- SOMETHING IS WRONG WITH PRINTING THE OR_BITS() RESULTS > printf(1,"%d\n",or_bits(#FFFF0000,0)) > ? or_bits(#FFFF0000,0) > > -- THIS IS WHAT SHOULD BE PRINTED > printf(1,"%d\n",#FFFF0000) > ? #FFFF0000 > > Bernie >