| Bill Allombert on Thu, 01 Feb 2024 08:40:41 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: Rational exponent |
On Wed, Jan 31, 2024 at 11:59:01PM -0500, Kevin Acres wrote:
> I have a function that I would like to use with rational exponents.
> Currently it only works with integral exponents.
>
> I'm struggling a little and any help is welcomed.
>
> Kevin.
>
> /*
> * z : Integer input 0..2^n-1
> * p : irreducible polynomial of degree n
> * n : output is in binary format 0..2^n-1
> * e : exponent
> */
> fn2(z,p,n,e) = {
> my(s,t=vector(n)~,k,a);
>
> if(z==0, return(t~););
> k = Pol(binary(z))^e;
> a = lift(Mod(k, p));
> s=Vecrev(a);
> s *= denominator(s);
> s %= 2;
> for(i=1,#s,
> t[i]=s[i];
> );
> t~;
> };
You should give an example and say what result you would like!
Cheers,
Bill