Bill Allombert on Sat, 14 Oct 2023 20:34:12 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: digits(n,-4)
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Sat, 14 Oct 2023 20:34:08 +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=1697308440; c=relaxed/relaxed; bh=9T6yONrir2zHQe53CrvXNxk5zQu4qnxIYu4m12UhHFs=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:Mail-Followup-To: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; b=fsilK/FHJ6MOZwykBDQiuPn6iD/9oXIEzTkR0Ys1JTC9njzF90e2KwMYdKfSPn7XKUMkE9NHOGgI4wFuhtLGPXmS/PEu0nVVEy6dr7Bwa3luctiu3IxUxcLVJZveoFnVdDtlAgU+/i9JHiSI0yi3dhwsPTJhVkLuCG52t81ol/WOZpmevUNC6fURWMrLGkmWKobvEHRkvX7l6xIXzE8FNl7e2pWNK4lNLWlMPuGaM+f/mWRI2hjbuOtsUfuDe39Txcwl2Ow/VogbCpc/exgV5qGbgT1Ht4AV4GgfXNtFQeITcTYLD0N/QyC4q3XEc8wJGx/3xZFm9eFELR1Uwxrq7icq25N4D2sol4yriSwqbLZpun2rrKR5colqBk2qK65aNPO6QgBaSWPpfO/B/rkxdOiWLbg+OvaPpysyvoMU2d3+M/hIzBaOQy/k0PGKOHwtva5UUPsFByXDJKJwDPN5KZ06qm1biKqcmToif9LiVY3gQZnnXLjg4dx97NDcq8CNH8oJKfRVY25ZxskK7UC9i/5WUm+HsaMlFB1kg3LOVJ6e0TQfKmmfsb1jUM7AmiyFl0N3BqsX1qqqfOaFr7U1pfXWR8TDXS9gJCZ4O5Y+HtvqhqE+hXY5a6EPHZ5/0Av/XHG2A1Aa/pGCdRkM+zb65mkTJhfnIJx4DeLJG/Bnw2o=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1697308440; cv=none; b=hlv/7Av7ZBV92iLq46LPzHRyLJHOzsibNhQkRT19drD7xeT8R/UZ6CHqFtviNP3EZy2N0QTosEwnnT1UkKTofsIGckyI2acDl5Kst6t7ACmt+74i9EG0fjbsakL460ADPn2bzXr1rzms8+gWFEjMBh6pKH+P/kWoKQ8ilfaoN19OORqrf0e78CcqAPA0MxET1GvpXQgALRQhr1F+RGDPgWkzisGPKn4MRCV9ZISW01Lgftru82g+Uy+uA5CsOjA3lrzXaESOx7vcxnJR9S5zCF79Im2pQGK5FDHQnOXCMCdXFjFpCrWaId+2PjHZSBQH3v+32ZNIbECtcpGl0ci9UN9h/VG6hFXvv4EK0tiiJQqYoU5yipfhTKRygxbqLEJnOQ4LpM1/9ALxX505Zbhu3WW8qPX8a4BKoS5XQNMEOh8ykn9Gu01MAyGVaT4pD8tqmyRuoLbgE88NRqTNPhDBecQTfXJc1tJCTmJ/UqPG+kFwwV8xKTOK/iaZpirOw8CY1wEmLTtxrT+ZStj3v3F0QpwEjq6QufXS+RF4IIbbvcSMcxazgjUzQATRdijcrY8w9NECnlQK+eLqIZ2OTANmP5uVH+1LnqYaOnO2SdUPr6iBXxjTftZR478LENPjrYQfkOhsWZ6O7SuLa6yf4OgZStQ+L4AzGrZfnVA78mX5H7w=
- Authentication-results: smail; dmarc=none header.from=math.u-bordeaux.fr
- Authentication-results: smail; arc=none
- Delivery-date: Sat, 14 Oct 2023 20:34:12 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1697308440; bh=9T6yONrir2zHQe53CrvXNxk5zQu4qnxIYu4m12UhHFs=; h=Date:From:To:Subject:References:In-Reply-To:From; b=gC8pRFm9TWD5rwc3UuGUvGLyDWH7DLhhSlyzfh1atQo1Z9eWgKr9TbtnVc4ZzeLVf UEkgYb8vwNnoGWC6oJp0FgTfEjXckm1+e1ceQlwROkZBBTHGQETJUiXyjaqqpidArT hZeA/5IvpwXPK+uZQAHUU4Lo7uJmkU6mJ5sPZLJp3WRrAcYPxC6xG5e+J9Scf2M6j7 NSrT2xutgL9JzIY+ro54cscVoKs6snitGrhHzccLetpX6qV9+OD3CVpdF3j/68T+Li PLvWwrVDHj0rx5ydzqoLswdfPhb2T+lJ75LWYk6RN6u0yCMzSRshbdJiDUvxqr+u7k PAdj/XAPkRYTCDu4jcx6XlejLLmfgoXMWR1Vq0nJobSW8W3V4L0043oe9d/2rYdVXb cRuy0Khtw8PKt8CP8M2omiveAQ57ZuGdr2PGhb6h0fWSJDGhfDSVBAUMgaKPooceNx 5jRWjoPn3yYHUlJZBwMTXeYVNElY4Kq0Hjndm43CfjjQL2esVDCr61fM59yrVYG/Z9 Wl6gnKpQXvR7jz0K90gb55hH0QWFQcjxcUVY4/NXaVSxwAadMj7w8G9eAAK7UVTfdq pTImryZ5nHHzr1cR8F1DkZ52rva7kFcPyl8lmC/y+xvu1yeS8W+4OwxrUpNcmlXUCJ y8rtCKOnRdkdeHK0A2OKYTmQ=
- In-reply-to: <e26cea43-8ead-4ad4-ad99-87912f425538@freedom.nl>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <e26cea43-8ead-4ad4-ad99-87912f425538@freedom.nl>
On Sat, Oct 14, 2023 at 07:24:35PM +0200, Ruud H.G. van Tol wrote:
>
> ? fromdigits( [1,3,0], -4 )
> % 4
Note that we do need to know that the set of digits is here.
> ? my(n=4, v=[]); while( n=divrem(n,-4), v=concat(n[2],v); n=n[1] ); v
> % [1, 3, 0]
>
> Is there a better way to do this?
I would start with use digits(n,16) and split the digits.
> Should digits() be changed to support a negative base?
There are too many variants...
Cheers,
Bill.