Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Forcing unsigned calculations
#37
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 arithmetic
(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....
Really? 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.

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 Smile
b]Hard Rock[/b]
[The Stars Dev Company] [Metal Qb flopped] [The Terror]
Stop Double Posts!
Whats better? HTML or Variables?
Reply


Messages In This Thread
Forcing unsigned calculations - by Zack - 02-16-2004, 08:18 AM
Forcing unsigned calculations - by Zack - 02-16-2004, 08:33 AM
Forcing unsigned calculations - by Zack - 02-16-2004, 08:38 AM
Forcing unsigned calculations - by Zack - 02-16-2004, 08:46 AM
Forcing unsigned calculations - by adosorken - 02-16-2004, 10:05 AM
Forcing unsigned calculations - by Antoni Gual - 02-16-2004, 05:24 PM
Forcing unsigned calculations - by Zack - 02-16-2004, 08:05 PM
Forcing unsigned calculations - by Agamemnus - 02-16-2004, 08:06 PM
Forcing unsigned calculations - by Zack - 02-16-2004, 08:08 PM
Forcing unsigned calculations - by TheBigBasicQ - 02-16-2004, 08:37 PM
Forcing unsigned calculations - by Agamemnus - 02-16-2004, 08:38 PM
Forcing unsigned calculations - by TheBigBasicQ - 02-16-2004, 08:47 PM
Forcing unsigned calculations - by adosorken - 02-16-2004, 09:20 PM
Forcing unsigned calculations - by Zack - 02-16-2004, 09:44 PM
Forcing unsigned calculations - by na_th_an - 02-16-2004, 10:05 PM
Forcing unsigned calculations - by Zack - 02-16-2004, 10:22 PM
Forcing unsigned calculations - by na_th_an - 02-16-2004, 10:41 PM
Forcing unsigned calculations - by Zack - 02-16-2004, 11:06 PM
Forcing unsigned calculations - by Mango - 02-17-2004, 05:55 AM
Forcing unsigned calculations - by Zack - 02-17-2004, 08:14 AM
Forcing unsigned calculations - by Agamemnus - 02-17-2004, 08:45 AM
Forcing unsigned calculations - by Zack - 02-17-2004, 08:50 AM
Forcing unsigned calculations - by Mango - 02-17-2004, 10:42 AM
Forcing unsigned calculations - by Zack - 02-17-2004, 07:33 PM
Forcing unsigned calculations - by TheBigBasicQ - 02-18-2004, 01:17 AM
Forcing unsigned calculations - by Zack - 02-18-2004, 01:57 AM
Forcing unsigned calculations - by TheBigBasicQ - 02-18-2004, 01:58 AM
Forcing unsigned calculations - by Zack - 02-18-2004, 02:02 AM
Forcing unsigned calculations - by TheBigBasicQ - 02-18-2004, 02:14 AM
Forcing unsigned calculations - by na_th_an - 02-18-2004, 04:07 AM
Forcing unsigned calculations - by Zack - 02-18-2004, 04:37 AM
Forcing unsigned calculations - by Mango - 02-18-2004, 06:31 AM
Forcing unsigned calculations - by Hard Rock - 02-18-2004, 06:38 AM
Forcing unsigned calculations - by na_th_an - 02-18-2004, 06:40 AM
Forcing unsigned calculations - by Hard Rock - 02-18-2004, 06:43 AM
Forcing unsigned calculations - by Zack - 02-18-2004, 07:43 AM
Forcing unsigned calculations - by na_th_an - 02-18-2004, 09:08 AM
Forcing unsigned calculations - by Zack - 02-18-2004, 06:55 PM
Forcing unsigned calculations - by na_th_an - 02-18-2004, 07:54 PM
Forcing unsigned calculations - by TheBigBasicQ - 02-18-2004, 09:28 PM
Forcing unsigned calculations - by Zack - 02-18-2004, 11:53 PM
Forcing unsigned calculations - by Mango - 02-19-2004, 04:53 AM
Forcing unsigned calculations - by Zack - 02-19-2004, 07:28 AM
Forcing unsigned calculations - by Agamemnus - 02-19-2004, 08:11 AM
Forcing unsigned calculations - by Zack - 02-19-2004, 08:40 AM
Forcing unsigned calculations - by relsoft - 02-19-2004, 11:11 AM
Forcing unsigned calculations - by TheBigBasicQ - 02-19-2004, 02:19 PM
Forcing unsigned calculations - by Zack - 02-19-2004, 07:21 PM
Forcing unsigned calculations - by TheBigBasicQ - 02-19-2004, 07:24 PM
Forcing unsigned calculations - by Zack - 02-19-2004, 07:28 PM
Forcing unsigned calculations - by TheBigBasicQ - 02-19-2004, 07:30 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)