开发者

Octave datatypes - float & double

I'm writing a framework for writing HDF files with JAVA (Using some existing framework). I need to keep compatibility with octave. That is, octave should be able to read the files my framework writes and vice versa.

My question is, does Octave have two data types - float and double or it uses only doubl开发者_如何转开发e?

thanks


Internally Octave handles both double scalar and float scalar, as well as float/double matrices. octave uses templates to instantiate the scalar type so octave can handle both types efficiently.

But your problem seems to be which data format to use when interchanging data with Octave using files.

Octaves default data format to save in is binary, e.g double precision floating point values. But Octave can save in float format, thus truncating the data.

Octave can also save in HDF5 format. All supported formats are listed here.

Java binary object serialization is on the other hand a little bit tricky. That is because Java supports reflection and can serialize and re instantiate objects automatically, but from my experience the file written is not compatible between JVM versions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜