Bill Allombert on Wed, 29 Jan 2025 14:42:21 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: 2^[1,3]
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Wed, 29 Jan 2025 14:42:15 +0100
- Delivery-date: Wed, 29 Jan 2025 14:42:21 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=math.u-bordeaux.fr; s=2022; t=1738158137; bh=nhRjnP/8/dW+OKobfx8Vg0ZfXiZr80r2l+OyGLJvLok=; h=Date:From:To:Subject:References:In-Reply-To:From; b=LKIXlgjUL7UdQevnMZsnJ4tUlwnD2s6M7zb5jb8+yoBqYn3MmFIomY8f2t6dKpO53 g6HpkBg8ROpx0c8L3YsI07cidmqRQxkI+/ylBT3boJjtBpylLf22Y+siXHYf/I1dW5 B8wX353Y5F0shKruwJXNDp7lcCw9wTBDCSLTDkP1lqk6drP1/ug+QXVbWkox0Vdu9Y nowy78lcyymn0/ujYKnhcHNOq/+jIkUwZl4+DBIE0/Wf25tR4KCi6DxZ5BVtLWhcgY uLazwv0UtK5xG1XozuyMwuLoopANGq6ChKCQJYrWBqb0JvK0/x4IXd6FjjHbr3rLsl BMpSWA6/NvBMHIxlxfptrR471RlPWtfARCG7/E5Z9z6Ul3vIktS6sOZfcM8VJpiUEf k7UOJuweW8EpIbZVtwSmXi50yJyxiU7pQGm3CkADmp4pKB2fR4qiSd7TEJJOsxXl8o 9lFg/OgtecUMKjtWNsyCwAVK5+xARH4iKRKVzgzqcr42wf3M9/aaFT7nxbO9ziOFQY GoRZ3IkcslvpOwQ2q77a0Ri8XYcCz3G+YbOnro3GeOShxs05vWSZ14a4GEPnP+23ex nngLtHHGrQxZEIby7Pzd08juOlE/wGyaPHvl572Pz6gqxDEMVIgBhBXFBah+LVOWia QiYdidvmSazaU54Ig4400fI8=
- In-reply-to: <d43e2330-fb29-4889-8a13-b90b99dd7f01@isolution.nl>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <d43e2330-fb29-4889-8a13-b90b99dd7f01@isolution.nl>
On Wed, Jan 29, 2025 at 02:28:46PM +0100, Ruud H.G. van Tol wrote:
>
> ? 2^[1,3]
> % [2.0000000000000000000000000000000000000,
> 8.0000000000000000000000000000000000000]
>
> ? vecsum(2^[1,3])
> % 10.000000000000000000000000000000000000
Use fromdigits:
? fromdigits([1,3],2)
% = 10
> I wonder why 2^[1,3] uses reals.
This is a trap: the vector rule only apply to floating-points operations.
> How to best convert something like (int) 6131786 to (int) 2^1 + 2^3 + 2^6 +
> 2^7 + 2^8?
You can use the binary() function.
Cheers,
Bill.
- Follow-Ups:
- Re: 2^[1,3]
- From: "Ruud H.G. van Tol" <rvtol@isolution.nl>
- References:
- 2^[1,3]
- From: "Ruud H.G. van Tol" <rvtol@isolution.nl>