Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Bitwise manipulation

From: philip:hayes:btcellnet at: 11-Oct-2000 16:08

An interesting one ... I have a integer value that I must convert to binary: Nice and easy for values <= 127 int1: 56 b1: to-binary to-block int1 HOWEVER, if int1 is greater than 127, say 2037, I have to perform the following task: 2037 which is equivalent to 0000100001011000 must be split into 2 bytes as follows b1: -> 00001000 effectively b1: to-binary to-block 8 b2: -> 01011000 effectively b2: to-binary to-block 24 Any suggestions.. Phil ********************************************************************** This email and any attachments may be confidential and the subject of legal professional privilege. Any disclosure, use, storage or copying of this email without the consent of the sender is strictly prohibited. Please notify the sender immediately if you are not the intended recipient and then delete the email from your inbox and do not disclose the contents to another person, use, copy or store the information in any medium. **********************************************************************