Ruud H.G. van Tol on Fri, 04 Jul 2025 16:04:49 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: flags in a bitmap
- From: "Ruud H.G. van Tol" <rvtol@isolution.nl>
- Date: Fri, 4 Jul 2025 16:04:43 +0200
- Delivery-date: Fri, 04 Jul 2025 16:04:49 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=isolution.nl; s=soverin; t=1751637884; bh=/HKJG7BMRFKx9efJDqB8H7w3Gj+Dk7Ow/d6fANIrhaM=; h=Date:Subject:To:References:From:In-Reply-To:From; b=PKU9CA8xDgy1cN1zpDd3Vkc60TTipFZEWfWxuRmroYYrgJmzJSI3kCUTn2smX4Pp0 NY7pJvmRsjAlZgpKYiIz1a3wwjRWwLBFeLuYkZywLnqlAggSqHu6TV5vBObRViT6Da 4X2b1F8yMSbGiPEO9BobLJyazYyNE/Pd4SUAxACiSaGBumqeT/zwOEXKKyZX5SgAcN IcrEbTSmcm8jwWy/52S5SX3HP3WeE2SCcCuEDa0aosXZsH5E+yhTA/FxBfOnj+2R1/ H5FHG8fnhl0zTSopG/9U4eDh60pnL8HWN05LD2dhKjDsPiAlM2XekPcOiXUCNdoDc7 4Xh55lfpOfAnw==
- In-reply-to: <aGeLgs8ZF0E5JYR1@seventeen>
- References: <0d611e03-20d3-4bf9-852e-f4be6858439e@isolution.nl> <aGZ8wfx91Ru1EToq@seventeen> <66438921-ed04-4927-97e0-b1ecee7a6aa3@isolution.nl> <aGeLgs8ZF0E5JYR1@seventeen>
On 2025-07-04 10:06, Bill Allombert wrote:
> I can do a git branch if you want to test:
>
> ? install(bitset,vWL)
> ? x=2^(2^20);
> ? forprime(p=2,2^20,bitset(~x,p))
> *** last result computed in 8 ms.
> ? my(S=0);for(i=0,2^20-1,S+=bittest(x,i));S
> %16 = 82025
> *** last result computed in 159 ms.
To set a base, first a pure-pari test:
? { my( bitset(~v,p)=v[1]=bitor(v[1],2^p), L=2^20, x=[2^L], s=0 );
forprime(p=2,L-1, bitset(~x,p));
for(i=0,L-1, s+=bittest(x[1],i));
print(s);
}
82025
cpu time = 1,857 ms, real time = 1,861 ms.
-- Ruud