octave-maintainers
[Top][All Lists]
Advanced

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

Re: NaN-toolbox much faster now


From: Jaroslav Hajek
Subject: Re: NaN-toolbox much faster now
Date: Wed, 18 Mar 2009 21:05:32 +0100

On Wed, Mar 18, 2009 at 7:12 PM, Jason Riedy <address@hidden> wrote:
> And Jaroslav Hajek writes:
>> Actually this somewhat similar to is what is done for integer
>> types - they raise global flags on operation or conversion
>> overflows. And this comes at the cost of encapsulating them in
>> a special class, which brings more problems... I don't see this
>> as a viable option for real types.
>
> It's already supported in IEEE-754 systems.  Use signaling NaNs
> as the stored NaNs.  Test for the invalid flag after operations.
> You still need to disambiguate between NaN-producing operations
> and sNaNs, and you need to filter NaNs so you store sNaNs.  Both
> are O(amount of data) and only are necessary if the invalid flag
> is raised.
>

I'd have no problems if this is supported by hardware. What I don't
want is to introduce octave_real (aka octave_int) to do some sanity
checks.

> Keeping the implementation sane requires setting the IEEE
> default, no-trapping mode.  Keeping the *use* sane requires some
> thought about integrating these features into Octave's language.
>
> So mean ([5, NaN]) could return 5 and set a flag or return an
> extra value to indicate a NaN was encountered.  But that would
> take quite some time & documentation to explain.
>
> There *SHOULD* be portable means to do this.  Many systems claim
> IEEE-754 compliance, and that means there is some mechanism
> available to carry out the above.  In reality, however, the only
> mechanism for access to these features (via C99) is not supported
> fully on many platforms.
>

I'm not sure I understand you well (I don't know anywhere as much as
you about the IEEE fp), but are you saying that with certain hardware
and software support, it is possible to check whether NaNs occured
*without* inserting software checks into every operation?
If yes, I think it would be nice to have that in Octave, even if it
would work only on some systems and require configure testing.

regards

-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

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