Read Statement using Negative Numbers
Archiver
Posts: 46,084
How can I read a negative number using the READ statement. If I read
a -1, and use it in calculations it looses it sign and coverts from a
twos complement into 255 when the math is done. hence if I try to
add the -1, I actually add 255. How can I instruct the variables
that the data is signed?
a -1, and use it in calculations it looses it sign and coverts from a
twos complement into 255 when the math is done. hence if I try to
add the -1, I actually add 255. How can I instruct the variables
that the data is signed?
Comments
shindel@n... wrote:
>
> How can I read a negative number using the READ statement. If I read
> a -1, and use it in calculations it looses it sign and coverts from a
> twos complement into 255 when the math is done. hence if I try to
> add the -1, I actually add 255. How can I instruct the variables
> that the data is signed?