#1✎ 46SaladFingersIs it possible to convert an integer to an 8bit signed integer?
Edit: I guess I wasn’t trying hard enough, my integer was already 1 byte long, just needed to get rid of the most significant bit.
Edit 2: I was wrong, I still need some help. I have a number, for example &B11111011 (251) and I need it to be represented as a negative, signed number.
#2✎ 162612Me21Head AdminThird YearMy account is over 3 years oldWebsiteSyntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express YourselfFor converting a signed number to a larger integer type (8 bit -> 32 bit) you can use the fact that >> preserves the highest bit:
#3✎ 12hanzoIt is possible if the integer is in the range of -128 to 127.
Could you refer to the following program?
WHILE A%<-128 || A%>127
INPUT"AN INTEGER (-128 TO 127)";A%
?"8BIT SIGNED INT OF ";:?A%
?" = ";:?"&B";:?BIN$(B%,8);
#4✎ 12hanzoI'm sorry I've lost your EDIT2 but it is very simple as follows.