help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: load hex data from a text file


From: Mike Miller
Subject: Re: Re: load hex data from a text file
Date: Mon, 28 Oct 2019 17:45:31 -0700
User-agent: Mutt/1.10.1 (2018-07-13)

On Mon, Oct 28, 2019 at 16:07:54 -0400, John W. Eaton wrote:
> Same here.  When I traced the execution of the load function, it ends up in
> the octave_read_fp_value function defined at line 247 in lo-utils.cc and
> tries to read a double value with the istream >> operator (that's line 292
> in the linked version of the file):
> 
> http://hg.savannah.gnu.org/hgweb/octave/file/5aad387784aa/liboctave/util/lo-utils.cc#l243
> 
> If the next characters on the input stream are "0xA", then unless I've
> specifically set the stream up to read hex values, I would expect to get a
> value of "0" with the next character to read being "x".  That's what happens
> for me, then the next read operation fails because the input is "x".  That
> some people are getting other results here might be be due to differences in
> the iostream library?  If we want to fix this for compatibility with Matlab,
> then the functions in lo-utils.cc should be extended with a special case to
> recognize hex values, similar to the way that they currently do extra work
> to recognize Inf and Nan values.

Yeah, you're right. It's another difference between the GCC and LLVM C++
iostreams implementations. I think this could be considered another
manifestation of https://bugs.llvm.org/show_bug.cgi?id=17782.

As a reminder, https://savannah.gnu.org/bugs/?47413 is a different
symptom, but similar underlying cause.

-- 
mike

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]