Silverfrost Forums

Welcome to our forums

ISHFT

5 Dec 2008 3:21 #4072

I have tried the following

INTEGER*1 i1Temp i1Temp=-116 i1Temp=ISHFT(i1Temp,-1)

-116 should be 140 as an unsigned integer so I would expect 70 as the result (basically I am trying to do an unsigned divide by 2)

Compiled with Checkmate this comes up with the error arithmetic overflow Compiled with Debug this doesn't throw up an error but it doesn't perform the operation.

Not sure why there is an error as a bit operation shouldn't result in arthmetic overflow?

Tried using RS instead of ISHFT and get the same result and error.

FTN95 version 5.10.0

Thanks

Mark Jordan

5 Dec 2008 3:46 #4073

The help file says that you cannot use ISHFT in this way.

How about using positive INTEGER2 values and then truncating to INTEGER1? There are probably many other ways to do it.

5 Dec 2008 4:26 #4074

Paul

Thanks - I missed that bit in the notes.

I have avoided INTEGER2 as the source data is an unsigned INTEGER1 binary file 14000 x 28000.

I have worked around the problem for now

Mark

Please login to reply.