Ruud H.G. van Tol on Wed, 12 Jan 2022 04:14:56 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: forbidden comparison
- From: "Ruud H.G. van Tol" <rvtol@isolution.nl>
- Date: Wed, 12 Jan 2022 04:14:47 +0100
- Delivery-date: Wed, 12 Jan 2022 04:14:56 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=isolution.nl; s=soverin; t=1641957287; bh=MN4qXZPWa+06o5IwuElDBz7mjugVcNzywS7iGjiI2aI=; h=Date:To:From:Subject:From; b=gmk14txwpC8vTjIFYrLMRUwQdSQvcsYt18asonbBvd/Azt3Bgoeei2XSFEGPwVAER gtocpV3gTRReow5dKhny3uZDduWyEDFD6cx/Kr1kff2hjE6pjzoalBPJe5m9c+mECG 3xJXwEVMXY9zgUDqNauLYQ9HhHYvbxQBliH7qI+b2ofOuctQbr07o5kJ+TNxVy709v 51DFv2pbX5dylJzwogiZPwyiPWpv0Ktxqm3boABPZgMDTJgecUlCVu75Po5T8CbqtN GTAhwz1xP5cctyh86zcZTRqGevLGLSj2rmJj7eSzRbkSWKCVHoMTMdCtOtpUhHZD8V 1UjfCcH9JvSew==
I expected this to just work:
my(v=23, c3=7); while( my(c=c3*2); c < v, c3=c ); print([v,c3]);
Now changed it to;
my(v=23, c3=7);while( c3*2 < v, c3*=2 ); print([v,c3]);
[23, 14]
With 'if', this works:
? my(v=23, c3=7); if(my(c=c3*2)*0+c, print(c))
14
but while has an extra scope?
-- Ruud
? print(my(c=25))
0
? print(my(c=25)*0+c)
25