Re: help reading fortran generated binary data...
- From: hgiese@xxxxxxxxxxxxx (Helmut Giese)
- Date: Wed, 17 Aug 2005 19:33:32 GMT
On Wed, 17 Aug 2005 19:00:08 GMT, "Jeff Godfrey"
<jeff_godfrey@xxxxxxxxx> wrote:
>
>"Helmut Giese" <hgiese@xxxxxxxxxxxxx> wrote in message
>news:430369e4.3997226@xxxxxxxxxxxxxxxxxxxxx
>> On Wed, 17 Aug 2005 16:36:03 GMT, "Jeff Godfrey"
>> <jeff_godfrey@xxxxxxxxx> wrote:
>>
>>>Hi All,
>>>
>>>First, for those not interested in the "long" story (below), here's my
>>>basic problem...
>>>
>>>I've read a value from binary file using the following code:
>>>
>>>binary scan $binaryData @${offset}d1 theData (1 double-precision
>>>floating
>>>point value)
>>>
>>>The value *should* be any of 0, 90, 180, or 270.
>>>
>>>What I get instead is 4 variations of an *extreme* (large or small)
>>>number,
>>>such as:
>>>
>>>5.4388530464437965e+185
>>
>> Hi Jeff,
>> what I would try next is to write out the 4 values you expect into a
>> binary file and have a look at it with a hex editor: question of
>> finding out what Tcl expects to see as 0, 90, 180, or 270 represented
>> as double.
>> Then look at the raw binary data you get. Can you locate the patterns
>> from above anywhere ?
>> If not, maybe FORTRAN stored doubles in a different format?
>> HTH and good luck
>> Helmut Giese
>
>Helmut,
>
>Short of anyone just "knowing" the answer
That would probably have been Arjen, Tcl's FORTRAN guru :) but he
seems to not be listening right now.
My FORTRAN days are long gone and anyway I never had to deal with
floating point values as raw binary data, so I am only guessing here.
But I wouldn't be surprised if FORTRAN (or at least a sufficiently old
compiler) did use a different means of storing doubles - I mean,
FORTRAN probably predates the IEEE standard on floating point
calculation by many years. And of course you can write them out and
read them back in using programs compiled with the same compiler -
like Borland Pascal users could when using the funny 6 byte floating
point type called Real which Borland invented - but of course nobody
else could.
If you know more details about the interpretation of your 4 values you
may want to turn to a FORTRAN news group.
Good luck
Helmut Giese
.
- Follow-Ups:
- Re: help reading fortran generated binary data...
- From: Arjen Markus
- Re: help reading fortran generated binary data...
- From: Jeff Godfrey
- Re: help reading fortran generated binary data...
- References:
- help reading fortran generated binary data...
- From: Jeff Godfrey
- Re: help reading fortran generated binary data...
- From: Helmut Giese
- Re: help reading fortran generated binary data...
- From: Jeff Godfrey
- help reading fortran generated binary data...
- Prev by Date: Re: help reading fortran generated binary data...
- Next by Date: text widget must follow end of text only if associated scrollbar is at bottom
- Previous by thread: Re: help reading fortran generated binary data...
- Next by thread: Re: help reading fortran generated binary data...
- Index(es):
Relevant Pages
|