limiting to "no less than" zero


Results 1 to 31 of 31

Threaded View

  1. #10
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,172


    Did you find this post helpful? Yes | No

    Default Re: limiting to "no less than" zero

    Related to the "default" just use the ! before your variable:

    If !buttonB then.... meaning If buttonB=0 then...

    The 15th bit is the sign bit in two's complement. When the most significant bit is 1, it indicates a negative sign. Just Binary maths...

    But is relative. If you use 8-bits then the 8th (most significant bit) is considered the sign bit. As long as you are thinking of positive and negative numbers. So at the end you have from -128 to +127 (1000 0000 to 0111 1111).

    http://en.wikipedia.org/wiki/Two's_complement

    Ioannis
    Last edited by Ioannis; - 17th September 2011 at 14:06.

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