help-octave
[Top][All Lists]
Advanced

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

Re: embedding octave - floating point exception


From: Marco Driusso
Subject: Re: embedding octave - floating point exception
Date: Thu, 12 Mar 2009 11:03:13 +0100

On 2009/3/11 Jason Riedy wrote:
Oy.  The tcl init code in ns-2 explicitly turns on trapping /
interrupts for division by zero.  There's a bizarre comment
before that code, but it looks like a conscious decision on their
part.

Are you talking about this one?

static inline void
setup_floating_point_environment()
{
[....]
    /*
     * In general we'd like to catch some serious exceptions (div by zero)
     * and ignore the boring ones (overflow/underflow).
     * We set up that up here.
     * This depends on feenableexcept which is (currently) GNU
     * specific.
     */
    int trap_exceptions = 0;
[....]
    trap_exceptions |= FE_DIVBYZERO;
[....]
    trap_exceptions |= FE_INVALID;
[....]
    trap_exceptions |= FE_OVERFLOW;
[....]
//    trap_exceptions |= FE_UNDERFLOW;
[....]
    feenableexcept(trap_exceptions);
[....]
}

in the .../ns-2.33/common/tkAppInit.cc ? If so, I've tried to change these exceptions and remove the wrapping around the calls to octave, but I got the older floating point exception. Debugging I realized that running my simulation in ns-2 I don't call this function. And so, could you please tell me the file  are you talking about, if is not this one?
Thank you so much for the collaboration, you're giving me a big help.

Marco
reply via email to

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