I have this function:
public static final int UNSIGN(short b){
return (b & 0xFFFF);
}
The intent here is to use the value in 'b' as if it were positive, by this I mean as if it were an unsigned int, capable of holding 65536 values. However, it doesn't work. For example:
If 'b == -122' the function returns '65414'.
I also tried this way:
public static final int UNSIGN(short b){
return (b & 0xFF);
}
But that would return me '48' if 'b == 304'.
I'm really lost here, hope someone can help out.