Paul Underwood on Tue, 07 Dec 2021 20:46:42 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: logical operators -- documentation
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: logical operators -- documentation
- From: Paul Underwood <paulunderwood@mindless.com>
- Date: Tue, 7 Dec 2021 20:46:35 +0100
- Delivery-date: Tue, 07 Dec 2021 20:46:42 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.com; s=dbd5af2cbaf7; t=1638906395; bh=iXnvedEPmLu452904vebWamwVRbOCFP4U7BYUvdgrIY=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=Tu9iPiXlU19fWveLx60pMy+Of0pc3q/IJ6iejxEV4D0dn+O9dUvpvCn8yaMWUE5v7 oOXL5hzdgdlEVzfdFDs0PBGGTiSbflp5wO4S83teK+qPoaHcvgvG9lxeYRPRWZd1kH IHXAG6AXlph0tKaIhCLDKvMq3Z2g3cyXTTD+Wdso=
- In-reply-to: <76be23dc-49c1-e0af-05bd-ecfc46f3a677@ug.edu.pl>
- References: <trinity-9196eeae-5ee0-40ac-9daa-e8c72d67871b-1638893607733@3c-app-mailcom-lxa07> <76be23dc-49c1-e0af-05bd-ecfc46f3a677@ug.edu.pl>
- Sensitivity: Normal
I am sorry for using "associativity" wrongly.
I don't think it is "precedence"; Both || and && have the same "priority" in the documentation.
Here is another example:
for(n=1,9,if(n%2==1 || 1<0 && 3<2 || 3>2 ,print1(n" ")))
1 2 3 4 5 6 7 8 9
I think the documentation should read "right to left". It currently reads:
"Any sequence of logical or and and operations is evaluated from left to right, and aborted as soon as the final truth value is known."
I think the upshot is that || does appear to have great precedence than &&.
Best
Paul