Peter wrote: > So, isn't anyone worried about gcc doing: 0xFFFFFFFF >> 1 = 0xFFFFFFFF ?! > gcc > for intel target implements this using the 'sar' instruction, which > defines it > as 'divide by two'. What am I missing ? E.g.: > > main() { > int a=-1, b=1; > printf( "hmm ? -1 >> 1 = %d (0x%08X)\n", a >> b ); > } > > prints -1 ?! MUST the ints be longs for it to work as expected ? I think > that > the result of >> is incorrect for all negative 'a', the correct result is > obtained by substracting 1. No ? > I wasn't following the conversation very closely, can you explain what you're talking about? What does this have to do with PICduino? -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist