02-18-2004, 06:38 AM
Quote:In fact if you use only logic operators, it does'nt matter if integers are signed or unsigned. That is important only if you use arithmeticReally? I have to run some tests again, in C i had large trouble with using signed integers for my LZW code, and upon closer examination, it seemed that the issue was once i shifted the sign bit to being set,right shifting then ignored the signed bit and only shifted the others, giving me very obscure and usless numbers.
(for example if you use x2 to shift left and \2 to shift right). In that cases you must catch the cases where sign bit exists or changes. It's somewhat tricky....
Im doing a port to Java now, and i dropped it for now, but ill have to look it up again. Worst case scenerio i can always do one shift, and check if its a negative number, and if so remove it and then do the rest of the math
b]Hard Rock[/b]
[The Stars Dev Company] [Metal Qb flopped] [The Terror]
Stop Double Posts!
Whats better? HTML or Variables?
[The Stars Dev Company] [Metal Qb flopped] [The Terror]
Stop Double Posts!
Whats better? HTML or Variables?