Kevin Ryde on Thu, 20 Jan 2022 01:13:38 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: forbidden comparison
- From: Kevin Ryde <user42_kevin@yahoo.com.au>
- Date: Thu, 20 Jan 2022 11:05:48 +1100
- Delivery-date: Thu, 20 Jan 2022 01:13:38 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.au; s=s2048; t=1642637607; bh=/ikSz9wgAiybhFPV1jlRNiu+IeGp81xqTkOxvvGOyVY=; h=From:To:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=iWHaEEpLQKlA6Sndf6lz5AH5OnGmWy3nWQZfSZZ9g4cv92UFheMHv0cde0Ad95vw0SkJZEHdp64c+xBex4/Eb65UhbjmEewwyQSPAJNvEOjwRYpqD71sLyKppV0EEq1cC3sneSFK8gvJ32M5BGqMTu0sfvM3DjpImS2PL7UiRZ/SzWLfqpIuebEI79QtAnAt45+m4rloOCMyFgozcPYLNYMXzQCXWspMYaFVmpQq6n/sgn4Q9j7xJTW2d2jE9ubHKXlzpz661IbU2MkKAmnLncpKauYOYCePJUNOCXBfZr3n3B+9Iqm/Q9+QnV6oN/LJfaWTqRjQCVMyyUrjDZRCwg==
- In-reply-to: <42cc39b6-483c-42f5-d6be-6d5baed86099@isolution.nl> (Ruud H. G. van Tol's message of "Wed, 12 Jan 2022 18:23:15 +0100")
- Organization: Bah Humbug
- References: <ea54f512-953c-0be4-30af-13d008a45bcc@isolution.nl> <Yd6VShSOjZC+uGBe@seventeen> <42cc39b6-483c-42f5-d6be-6d5baed86099@isolution.nl>
- User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
"Ruud H.G. van Tol" <rvtol@isolution.nl> writes:
>
> my( v= 23, c3= 7);
> \\ ...
> my( c= c3 * 2 ); while( c < v, c3= c; c*= 2 ); \\un-oddify
> What are alternative ways to do such?
Logs can give you k shift either right or 1 too big, and compare to see
which.
k = logint(v,2) - logint(c3,2)
c3 <<= k;
if(c3 >= v, c3>>=1)