FLOAT BINARY(52) into a FIXED BINARY(15)? 
Author Message
 FLOAT BINARY(52) into a FIXED BINARY(15)?

Can this type of assignment be made?

COPIES FIXED BINARY(15)
TMP52 FLOAT BINARY(52)
...
IF COPIES > 99 THEN
 DOERRORROUTINE;
ELSE
 COPIES = TMP52;
...

I am sure that TMP52=COPIES will work, but
am not sure about the above example.

Tim Bratcher
San Diego, Ca.



Mon, 10 Sep 2001 03:00:00 GMT  
 FLOAT BINARY(52) into a FIXED BINARY(15)?

Quote:

> Can this type of assignment be made?

> COPIES FIXED BINARY(15)
> TMP52 FLOAT BINARY(52)
> ...
> IF COPIES > 99 THEN
>  DOERRORROUTINE;
> ELSE
>  COPIES = TMP52;
> ...

Sure, why not?  Depending on the value of TMP52 you may get a 'SIZE'
condition signaled. (possibly 'FIXEDOVERFLOW'?)


Mon, 10 Sep 2001 03:00:00 GMT  
 FLOAT BINARY(52) into a FIXED BINARY(15)?

Quote:

> Can this type of assignment be made?

> COPIES FIXED BINARY(15)
> TMP52 FLOAT BINARY(52)
> ...
> IF COPIES > 99 THEN
>  DOERRORROUTINE;
> ELSE
>  COPIES = TMP52;
> ...

> I am sure that TMP52=COPIES will work, but
> am not sure about the above example.

Perfectly valid.  Did you want to make sure that
FIXEDOVERFLOW is on, or perform a test that the
value of TMP52 does not exceed 32767 in magnitude?

However, not sure what the test means.  Is that
_really_ a test that COPIES exceeds 99? And not
TMP52 > 99?

Quote:
> Tim Bratcher
> San Diego, Ca.



Mon, 10 Sep 2001 03:00:00 GMT  
 FLOAT BINARY(52) into a FIXED BINARY(15)?
You're right, there is a test on the value of TMP52,
I just chopped the code too much before I posted the
question.  I had to ask that question because I would
never assign a float to an int in C, without an explicit
cast.  And even then it doesn't seem like a good thing
to do.  Somebody mentioned that the calls we make to the
compiler we are using turns off some of the warnings, so
I am checking into that too.
Thanks for the responses.

Tim

Quote:


> > Can this type of assignment be made?

> > COPIES FIXED BINARY(15)
> > TMP52 FLOAT BINARY(52)
> > ...
> > IF COPIES > 99 THEN
> >  DOERRORROUTINE;
> > ELSE
> >  COPIES = TMP52;
> > ...

> > I am sure that TMP52=COPIES will work, but
> > am not sure about the above example.

> Perfectly valid.  Did you want to make sure that
> FIXEDOVERFLOW is on, or perform a test that the
> value of TMP52 does not exceed 32767 in magnitude?

> However, not sure what the test means.  Is that
> _really_ a test that COPIES exceeds 99? And not
> TMP52 > 99?

> > Tim Bratcher
> > San Diego, Ca.



Tue, 11 Sep 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Reading binary files, unflatten binary string

2. convert binary number to binary string

3. Converting Binary To String (with out binary representation)

4. Reading a binary file / writing binary data to a file

5. simple convert decimal to binary and display binary

6. Converting VMS binary files to PC binary

7. Binary vs non-binary

8. binary clauses,n-ary to binary clauses

9. 16-bit signed binary to binary coded decimal(BCD) ascii

10. Reading binary double floats from an old data file

11. Binary search for fixed length ascii files.

12. Simple way to demo problem with binary floating point math

 

 
Powered by phpBB® Forum Software