Re: Identifting sign in COMP data
- From: Louis Krupp <lkrupp@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Jun 2007 02:36:23 -0600
kimi wrote:
Hi ppl,
Can anyone tell me how to recognize whether the COMP
variables are negative or positive.
For instance in COMP-3 data , if the last nibble is 'C' then we say it
is positive and if it is 'D' or 'F' we say it is negative.
Similarly how can we recognize whether the number is positive or
negative in COMP , COMP-1 and COMP-2 data.
Hi, Kimi!
Do you actually have COMP-3 data in which the last nibble is 'F' and this indicates a negative number? This ... surprises me.
For COMP data, it's probably safe to assume (someone correct me if I'm wrong) that the high-order bit indicates the sign; if the bit is on, the number is negative. The value as a whole is *probably* twos-complement, but I've worked on systems that used sign-magnitude.
For COMP-1 and COMP-2, the high-order bit *probably* indicates the sign (just like with COMP), but it depends on the floating-point format, and you'll have to know what format you're using before you can get anything else out of the data.
Is this part of your project to read COMP-1 and COMP-2 data from your mainframe? Out of curiosity, how's that going? And which mainframe is it?
Louis
.
- Follow-Ups:
- Re: Identifting sign in COMP data
- From: kimi
- Re: Identifting sign in COMP data
- References:
- Identifting sign in COMP data
- From: kimi
- Identifting sign in COMP data
- Prev by Date: Re: Identifting sign in COMP data
- Next by Date: Re: Identifting sign in COMP data
- Previous by thread: Re: Identifting sign in COMP data
- Next by thread: Re: Identifting sign in COMP data
- Index(es):
Relevant Pages
|