From f7ad5d01d2b4db1c3f7f63807317f93a2a20bdf2 Mon Sep 17 00:00:00 2001 From: pommicket Date: Fri, 6 Sep 2024 18:12:41 -0400 Subject: Fix problem with choose 2 detection --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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) } -- cgit v1.2.3