[back] [prev] [next] [index] [root]

 


RationalReconstruct

Lifts an integer modulo m to a rational.

Syntax:

q := RationalReconstruct (u,m);

rational
  q  
integer
  u  
integer
  m  

See also:  EltReconstruct

Description:

Given positive integers u,m, the function RationalReconstruct computes a rational number q = frac{a}{b} such that a \equiv bu \bmod m and 0 \le |a|,b < \sqrt{frac{m}{2}},b \neq 0, if such a pair exists. Otherwise the 0 is returned.


Example:


kash> RationalReconstruct(17,49);
> 2/3


<- back[back] [prev] [next] [index] [root]