Discussion Board
Go to the previous messageGo to the following message
Current Forum: Homework 4 General Forum
Date: Tue Oct 2 2001 10:34 pm
Author: Danish, Matt R. <mrd@cmu.edu>
Subject: Re: Binary data

I understand the concept of a range of -127 to 128 and why it might be handy to preserve twos complement. Nonetheless, for this purpose, while adding 128 will work, it will result in an array that has the first 128 bytes flipped with the second 128 bytes; one that defeats the point of having an array indexed by character number. You can flip them back, but my solution is to write a method that adds 256 if the value of the byte is negative and returns it casted if positive. This can easily be implemented as a filter, making its application straightforward.

Post response

Go to the previous messageGo to the following message
Current Thread Detail:
Binary data +Attachment      Danish, Matt R.      Tue Oct 2 2001 8:35 pm       
Re: Binary data      Lee, Peter      Tue Oct 2 2001 9:34 pm       
Re: Binary data      Danish, Matt R.      Tue Oct 2 2001 10:34 pm       
Re: Binary data      Lee, Peter      Tue Oct 2 2001 10:38 pm       
Re: Binary data      Cipriani, Jason A.      Thu Oct 4 2001 10:26 am       

Back to previous screen