Reading double written by java

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Reading double written by java

sting
I have some binary data files written by java and I am trying to read them intoOctave.  I am new to Octave so I only think I know some of the basics.

The file starts with 40 double's so I try to read them with:

fread(fid, 1, "double") and I get a number like: 6.6501e-133 and when the value is read from a java program the number is 0.9271877560931512.  Is there something wrong with the format?
Reply | Threaded
Open this post in threaded view
|

Re: Reading double written by java

Sergei Steshenko




----- Original Message -----

> From: sting <[hidden email]>
> To: [hidden email]
> Sent: Wednesday, July 20, 2016 11:52 PM
> Subject: Reading double written by java
>
> I have some binary data files written by java and I am trying to read them
> intoOctave.  I am new to Octave so I only think I know some of the basics.
>
> The file starts with 40 double's so I try to read them with:
>
> fread(fid, 1, "double") and I get a number like: 6.6501e-133 and when
> the
> value is read from a java program the number is 0.9271877560931512.  Is
> there something wrong with the format?
>
>
>
> --
> View this message in context:
> http://octave.1599824.n4.nabble.com/Reading-double-written-by-java-tp4678713.html
> Sent from the Octave - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Help-octave mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/help-octave

>


You have to first find out in what format you Java application writes.

--Sergei.

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave