summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2024-09-06 18:12:41 -0400
committerpommicket <pommicket@gmail.com>2024-09-06 18:12:41 -0400
commitf7ad5d01d2b4db1c3f7f63807317f93a2a20bdf2 (patch)
treedac3338bad21fec5bfa30ee041a99ba487d62839 /src
parentbae0f2a2a7e6f87a550fee773e0ef9444d03d028 (diff)
Fix problem with choose 2 detection
Diffstat (limited to 'src')
-rw-r--r--src/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 3500847..a61548d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -7,7 +7,7 @@ use std::process::ExitCode;
// bnum seems to be slightly faster than ruint,
// and 3x faster than uint.
-type UInt = bnum::types::U256;
+type UInt = bnum::types::U512;
fn is_square(n: UInt) -> bool {
let sq = n.sqrt();
@@ -15,7 +15,7 @@ fn is_square(n: UInt) -> bool {
}
fn is_choose2(mut n: UInt) -> bool {
- n <<= 1;
+ n <<= 3;
n.inc();
is_square(n)
}