Android Question Byte Capacity

Discussion in 'Android Questions' started by BarryW, Feb 16, 2015.

  1. BarryW

    BarryW Active Member Licensed User

    Hi masters, first here is my code ....

    Dim b() As Byte = Array As Byte(120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130)
    For Each i As Int In b
    Log(i)
    Next

    Log result is: 120, 121, 122, 123, 124, 125, 126, 127, -128, -127, -126

    My Question is why does it not return the true value of 128, 129 and 130?

    Pls help. Tnx . . .
     
  2. NJDude

    NJDude Expert Licensed User

    The range for a byte is from -128 to 127

    You can get some more info about ranges on THIS post, and even more info HERE.
     
    Last edited: Feb 16, 2015
    thedesolatesoul likes this.
  3. Troberg

    Troberg Well-Known Member Licensed User

    Byte is an 8 bit signed integer.
     
    thedesolatesoul likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice