Bill Allombert on Sun, 09 Jul 2023 11:02:21 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: How to do t_INT bit operations?
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: How to do t_INT bit operations?
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Sun, 9 Jul 2023 10:57:34 +0200
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1688893047; c=relaxed/relaxed; bh=kOgapE2dKam+A2zpJy1BpNnF5gIu0ay3eRHaMnfW3mo=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:Mail-Followup-To: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; b=c9d923T5YDmT48VfsSwz6xMtLmh36ygkmaYqKjmt5ucWE6vxnp2Mn/aRcm845AsmdOjjXSAn+AZ8RLCOuVCOd5vKq6dXKi2d+z9pP6AyU450RMDcFP3Ii1LwrnXxJT3MBUNSB7kFljggmN07HclUe+tlX+W6S1Oa0fOUG9z3nKpeKDsXA6vXHSrfKCGj48a5eLunTkIv5eUPIXFPBvZFoSBpeLLJqmZ3HFGODHT1oadsd4bot2Bglzy67PDYB2hGu7WqArpgAuFOBPfe/X6C7yDscXRipFmgnJyFZUrfayMjk/A9UBf8mti17d/k2eGhu/emxZCoULiyB6T6yY49k4X/3omQ+zBwHZUilcSXiu/4q9rHHtifdrJOAz1PYyVd7FXNEWktOqT04OVkFZGgxPpxmkbn9/72IIgraC2r1H3WrnJWwRRu6Dxib9b6OR2g8V9gHL8I+/8/yeuC82vsQNJNbKzwz+t6rF12+SUaQtjjacF+UbyOLDbqyRoN1ozKZSKmvoSChYMGlT7odyEO1+IhGdMV1BXJX3UdMD3ZhFi17rpNerQ/qbWlzoQ1JhZOCzrBDSw/AbMf/8hMeTCrhkFEvszHGCHVhp2JxnHWGJDKr8XJ3bn4wFqCaXDUwTfG85NlAxAlaLlmdPeWcjmWKfJESx4xe7HLfVaG4XBAZ7w=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1688893047; cv=none; b=UJsH/pAK1Vz4DWasBM2KsQuIAmXLNugv+ve5c+EA0TmzVsayiuktOUUQdtqoppWR5eDZ6Rk4DA7pCkPuAbe0z0y4J9fuFHMlev10t+7NphOPePnVJi8HCDIWwfaZUCCcfmrqvs488bMuR+qdG4jBzvBEUtQ7eEu8LlTy6tIwkZnnhKqaP1IboGvQvu3oLBuzWWAcovknAcAKzoApWyh7sAPZH4zBNOoPiSXpUksxV7GDF0c2/VCzzEC7r/U2HC7WBEr4GgvsyeJSaHvh2lTRg6Nd00Nzo3g+5yFh24Hz5VyZ8yaL97Trn56jT6dERlTVInyljHbw6KSEnL9f6VxkfHEqsutL2QsgfJiwNp7MfJ6XC4l9ZvGyfsFUD8mLYSe4sBq22ujrCO4FE/cPcni/vnDORdNcPPKkP3tPbsjBKcbwlZEbTouxuucVXvsTH6TxGn+I8Hiiyg6NV6lMY/SpLlVEgaXX+7tJKMp8oGQLiVASuVqNwjh/C2jhjr9Hl8SqfEzLVeJWvIJmdHaySzMcF6/3YZFrLCX0q+zQuXbQ5mpbP5MJdXgCjy5JXn6WGDBa9wKHPXfQLPIzBKE/sHkgMqxalUEy1P1FXRe2oXI8nlfvgURZLoLnmLJaqQk1v0G1yQKn0rcCK4NbZd7FK3vCNoOgO5mOim1ICrgBNiGlWfo=
- Authentication-results: smail; dmarc=none header.from=math.u-bordeaux.fr
- Authentication-results: smail; arc=none
- Delivery-date: Sun, 09 Jul 2023 11:02:21 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1688893047; bh=kOgapE2dKam+A2zpJy1BpNnF5gIu0ay3eRHaMnfW3mo=; h=Date:From:To:Subject:References:In-Reply-To:From; b=YTS2Cc95Tx/gLKABitGeksPYdi25N3h9yGhHuCKIA3Ey7IMELJZSHk24rm4Efvhav mbSSVPk2yUpZU1fhmQB7Tf83bTAYn1g0eurnkJV/eTSP/2IBp6B3wqGVjh5ZPuXAXp I48eiipWOMFnNzzCiWHrgcgJaBrsVPA0pwgOpfpA4QqgaJtMO7PnAagAUS23wp3Uvj p8cs3GDg2yRVwX6rmm/9F8NQ0gD8N7dMnq+7GPqXJ8qTb5ZYhz6gdbtRosxKcQ6txe 6LNKv1XKA4Ckjy1GYGXnwMUIbyKVw7keTarq3FScCcuXA9vOkYSnbaaQlXfDQhSWLs TrqIhYgEnjtBXwTPj+ACH31qJyBatFMOK06TjSxZ0iav1ebU2JF00phFaFnfVGFkd+ l9uFs5zELcDY6DF6ZMmZuVS+9xRw75WDtAc1IphxK5PzjEGBe6FAlAjl+t0xd6moD2 Ut5kw9FyA9RlsN6dcVUFvSnU6bWk597dxwHSphlenq0V4Yidim6bcoqOahYhD5p3ks rZ05r4VOeYEmvwt+aMi4aU/DheUtppR2tDyrQj2stc5wRPKVrT1n7KlEJYjCsW66Lx 4tLitD1C10EP4aZabL5wiIe57PRKvVH9FbJn++FI7i63RQyG75Rr+liVJpNz7u7zb3 xAz9x41QlGb0+HZgasp9PMw0=
- In-reply-to: <ec83bee2-cd43-bb26-574b-8f57f89ce3f5@isolution.nl>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <60edf47dd3c5627f813207e44b17c85c@stamm-wilbrandt.de> <ZKXBag2JmVVYrvWD@math.u-bordeaux.fr> <ca7cee20-159d-d814-baa0-20581fd7d2b1@isolution.nl> <65ff22a3f4469ff29ae1df8dae70e050@stamm-wilbrandt.de> <ec83bee2-cd43-bb26-574b-8f57f89ce3f5@isolution.nl>
On Thu, Jul 06, 2023 at 09:56:52AM +0200, Ruud H.G. van Tol wrote: >
> On 2023-07-06 09:14, hermann@stamm-wilbrandt.de wrote:
>
> > print(Str(gettime())"ms");
>
> Just to nitpick:
>
> Str() can be used as a string-concatter,
> but print() already does that itself.
>
> AFAIK, these do about all the same:
>
> print(Str(gettime())"ms");
> print(Str(gettime())ms);
> print(Str(gettime()),"ms");
> print(Str(gettime(),"ms"));
> print(Str(gettime()ms));
> print(gettime()ms);
> print(gettime(), "ms");
Point of order:
The comma-less form of print, Str, etc. should be considered as deprecated.
It is not entirely well-specificied.
(for example, in old GP versions 'print("a"+1)' gives 'a1')
When I wrote the new GP parser, I try to I kept it to avoid breaking old GP script,
but it should not be used for new script.
gettime() is also not recommended for new scripts because is not reentrant:
fm(n)=gettime();my(F=factor(2^n-1));print("time for ",n,":",gettime());F;
total(a,b)=gettime();for(n=a,b,fm(n));print("total time:",gettime());
We get
? total(200,210)
time for 200:4
time for 201:118
time for 202:462
time for 203:9
time for 204:0
time for 205:61
time for 206:151
time for 207:40
time for 208:14
time for 209:123
time for 210:0
total time:0
the total is wrong.
getabstime do not have this problem.
Maybe we should introduce a short-cut for [getabstime(), getwalltime()]
for parallel scripts.
Cheers,
Bill