Kevin Acres on Thu, 01 Feb 2024 05:59:06 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Rational exponent
- From: Kevin Acres <research@research-systems.com>
- Date: Wed, 31 Jan 2024 23:59:01 -0500
- Delivery-date: Thu, 01 Feb 2024 05:59:06 +0100
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=research-systems.com; s=default; h=Message-ID:Subject:To:From:Date: Content-Transfer-Encoding:Content-Type:MIME-Version:Sender:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tnDBLWIWP+Pw2I50r1IbYWbV+ntcfoVMYi5HRrD/EkU=; b=SPO4rteOd6cm8xzWpZDTb44EY XQSPMvo4Xnu0ctRJQhgipBk7qvlITccocwd5164Dnk0ypjQorD2VEknTRqpjxCz53JxnmGMG41D/8 q451o4/jhrvWAm3maFtv9de1/owAFMAFr0JkILx4C8Q33f3VlQ4bzxqrvFwc2w0hbcodx3+P73qAC ESSf9LKZlhra9zbDtQXBqjozNf00vQavXes0OsrAxZkBtTR+7SjgW9tv7bOr5baJ524pr114Z7ye4 O9rFfT2XJ8NNo3GyJUSsXXero6WZXRmfiIwJhu4cIK0chfmLFz8zEPn2jrEdsBGViNpMRjaIIwLPy xdlh7Q11Q==;
- User-agent: Roundcube Webmail/1.3.6
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~;
};