Convert a 'signed' Word to a Long with minimum manipulation ?


Results 1 to 8 of 8

Threaded View

  1. #6
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    PBP's shift algorithms dont work on negative numbers. You either have to divide instead, or do something like this:

    lCTemp=(B5+8)>>4
    IF lCTemp.27 THEN lCTemp=lCTemp&$F0000000

    (Untested)

    *edit* note that the division will always round down (towards negative infinity) when shifting no matter if the number if positive or negative. e.g. 5/2 = 2, but -5/2 = -3 (only for shifting - not division)
    Last edited by Kamikaze47; - 27th May 2010 at 15:27.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts