#### Archived

This topic is now archived and is closed to further replies.

# Bitwise algebra question

## Recommended Posts

I''m trying to implement a radix sort working with single precision floatpoint values. I''ve gotten it to work, and now I''m trying to improve it sections of the code which I needed to alter from my normal radix sort to get it to handle negatives correctly. In my inner loops(biulding the histogram & the each loop for each byte position) I have the following:
// When the sign bit is set, xor with 0xFFFFFFFF (flip every bit)

// When the sign bit is unset, xor with 0x80000000 (flip the sign bit)

var
value : longword;
...
value := ...
if (value and $80000000) <> 0 then value := value xor ($FFFFFFFF)
else

• ### Forum Statistics

• Total Topics
628308
• Total Posts
2981979

• 9
• 9
• 13
• 11
• 12