Fix subtraction overflow.
This commit is contained in:
1 parent
91c9eaf1b9
commit
97d756bab4
1 file changed
+5
-3
+5
-3
@@ -76,9 +76,11 @@ fn main() {
|
|||||||
arr[n2] = !arr[n2];
|
arr[n2] = !arr[n2];
|
||||||
}
|
}
|
||||||
|
|
||||||
let n3 = ((3 * x * x) - (y * y)) as usize;
|
if x > y {
|
||||||
if x > y && n3 <= (opts.num as usize) && n3 % 12 == 11 {
|
let n3 = ((3 * x * x) - (y * y)) as usize;
|
||||||
arr[n3] = !arr[n3];
|
if n3 <= (opts.num as usize) && n3 % 12 == 11 {
|
||||||
|
arr[n3] = !arr[n3];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user