problem with gmp_add_ui/floating point exception

Sisyphus sisyphus1 at optusnet.com.au
Tue Mar 22 05:13:03 CET 2005


----- Original Message ----- 
From: "DUDE man" <dude_m at hotmail.com>
To: <gmp-discuss at swox.com>
Sent: Tuesday, March 22, 2005 1:20 PM
Subject: problem with gmp_add_ui/floating point exception


> Hello all,
>
> Sorry to bother you all again. I'm working on a factoring program and I
keep
> getting this floating point exception when I go into the mpz_add_ui
> function. I've included the core dump and the code. Any help would be
> greatly appreciated. When I checked the add function outside the while
loop
> it worked, I wasn't sure if these functions used threads or why it would
> possibly do this.
>
> Thanks,
> Evan
>
> P.S. I'm running this on cygwin in Windows XP if that matters at all (I'm
> not sure why it would).
>

The error I'm getting with the attached 'quad.c' (on native Windows 2000) is
a "divide by zero" - which seems to happen when it comes to:

if(mpz_divisible_p(q, factorbase[11]) != 0)

I think this happens because factorbase[11] is, in fact, 0.

Cheers,
Rob



More information about the gmp-discuss mailing list