michel-leonard/C-Quadratic-Sieve

potential divide by zero?

Closed this issue · 2 comments

Is that an intentional divide-by-zero at line 218 of fac_utils.c ?
} else b = (n == 0) / 0.;

Also, at line 55 of cint.c, is there any reason why cint_clear_sheet() is not also static ?
void cint_clear_sheet(cint_sheet *sheet) {

Hello and thank you,

The b = (n == 0) / 0. branch should never be taken by this software, this fatal error it's a normal behavior with logarithms (they are defined with positive numbers only).

The cint_clear_sheet function has no reason not to be static, it's upadated, thanks.

Makes sense. Thanks.