mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 07:08:48 +00:00
big: Fix internal_int_mod for inputs with opposite signs.
This threw off Frobenius-Underwood.
This commit is contained in:
@@ -185,14 +185,14 @@ internal_int_kronecker :: proc(a, p: ^Int, allocator := context.allocator) -> (k
|
||||
a1.digit[0] + 1 cannot overflow because the MSB
|
||||
of the DIGIT type is not set by definition.
|
||||
*/
|
||||
if a1.digit[0] + 1 & p1.digit[0] & 2 != 0 {
|
||||
if ((a1.digit[0] + 1) & p1.digit[0] & 2) != 0 {
|
||||
k = -k;
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
Compute k = (-1)^((a1-1)*(p1-1)/4) * k.
|
||||
*/
|
||||
if a1.digit[0] & p1.digit[0] & 2 != 0 {
|
||||
if (a1.digit[0] & p1.digit[0] & 2) != 0 {
|
||||
k = -k;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user