negatives


Closed Thread
Results 1 to 7 of 7

Thread: negatives

Hybrid View

  1. #1
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Post Copy/Paste from the manual

    If any are preceded by an S (for signed), the output will be sent
    preceded by a “-“ if the high order bit of the data is set. This allows the
    transmission of negative numbers. Keep in mind that all of the math
    and comparisons in PBP are unsigned. However, unsigned math can
    yield signed results. For example, take the case of B0 = 9 - 10.
    The result of DEC B0 would be “255". Sending SDEC B0 would give “-
    1" since the high order bit is sent. So with a little trickery, the unsigned
    math of PBP can yield signed results.
    Regards

    Sougata

  2. #2
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default I never knew that

    Thanks Darrel. This second post is because I have always skipped that portion of the manual and done it in hard way. Thanks again.
    Regards

    Sougata

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    I never knew that
    Can't say that anymore.

    Glad to help.
    <br>
    DT

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