[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Testing endianness
From: |
Paul Kienzle |
Subject: |
Re: Testing endianness |
Date: |
Fri, 16 Jan 2004 21:25:05 -0500 |
On Jan 16, 2004, at 12:49 PM, John W. Eaton wrote:
How about the following patch? With it
octave_config_info ("words_big_endian")
and
octave_config_info ("words_little_endian")
return TRUE or FALSE, and
octave_config_info ("float_format")
will return a string (either ieee_big_endian or ieee_little_endian on
most current systems where Octave can actually run, the notable
exception being the Cray SV1).
If ever I need this (and I don't see why I would since
fread/fwrite deals with endian issues for me), how
would I use it? Do I need to test both conditions as
in the following:
if octave_config_info("words_little_endian")
do little endian stuff
elseif octave_config_info("words_big_endian")
do big endian stuff
else
error("not little endian or big endian")
endif
Thanks,
Paul Kienzle
address@hidden
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------