I'm replying to myself, sorry. I forgot to add that I'm running this on
Linux Ubuntu Breezy on a dual Xeon computer.
Does someone know why the function below works fine in a basic C program but
crashes in NS-2?

Thanks in advance,
Arkaitz


On 4/25/06, Arkaitz Bitorika <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I am using a Python numerical library (http://www.numpy.org/) embedded in
> NS, and while there's no problem on most of the functionality, I've found
> that there's a function that throws a Floating point exception whenever it's
> called from NS. This function is pasted below, it has no dependency on
> Python, it also throws the Floating point exception when called from a
> vanilla NS-2 installation:
>
> double
> pinf_init(void)
> {
>     double mul = 1e10;
>     double tmp = 0.0;
>     double pinf;
>
>     pinf = mul;
>     for (;;) {
>         pinf *= mul;
>         if (pinf == tmp) break;
>         tmp = pinf;
>     }
>     return pinf;
> }
>
> This function runs fine when called from an empty main() C++ program, but
> if called from NS-2 I get the Floating point exception. Any idea what may be
> causing this crash?
>
> Thanks,
> Arkaitz
>

Reply via email to