I would like to use readBin to read a binary data
file.  Most of the data is 4-byte floating point but,
for some reason, only double precision appears to be
offered.  I tried 
fVariable=readBin(iFile,what=single());
and got 35.87879 which looks believable except that
the correct value is 3.030303.  I then tried
fVariable=readBin(iFile,what=single(),4);
and got 
[1]  3.831111e+10  6.657199e+10 -5.592394e+29
-5.592397e+29

For the second call, there were two more single
precision floats of value 3.030303 followed by two
more with values 40.46 and 0.00 respectively.

Is there any way around this problem other than to
make the input data double (which I definitely do not
want to do)? 

Many thanks in advance,
Peter.

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to