B4J Question Bit. functions

woniol

Active Member
Licensed User
Longtime User
Hallo.
I'm a bit confused about Bit. functions:
My example is:

B4X:
Dim ss As Byte
ss=0xfe   
Log(Bit.ToHexString(ss))

in log i get : fffffffe
but i expect fe

I know that Bit functions use int , but why fffff is added instead of 00000
 

woniol

Active Member
Licensed User
Longtime User
OK, think i found it.
byte is a signed byte with values -128 to 127 not 0 to 254
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…