Esempio n. 1
0
    private Page PageAtLocation(PageLocation location)
    {
        var        hexName          = new BigInteger(location.Hex.Name, 36);
        BigInteger absoluteLocation = hexName + relativeLocationOffset * ((location.Page - 1) * 10000 + (location.Book - 1) * 100 + (location.Shelf - 1) * 10 + (location.Wall - 1));

        absoluteLocation = BigInteger.ActualModulus(absoluteLocation, pageLCGParams.m);

        return(new Page()
        {
            Location = location,
            Text = AbsoluteLocationToPageText(absoluteLocation)
        });
    }
Esempio n. 2
0
 public static BigInteger InverseLCG(BigInteger x, LCGParameters p)
 {
     return(BigInteger.ActualModulus(p.aInverse * (x - p.c), p.m));
 }
Esempio n. 3
0
 public static BigInteger LCG(BigInteger x, LCGParameters p)
 {
     return(BigInteger.ActualModulus(p.a * x + p.c, p.m));
 }