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) }); }
public static BigInteger InverseLCG(BigInteger x, LCGParameters p) { return(BigInteger.ActualModulus(p.aInverse * (x - p.c), p.m)); }
public static BigInteger LCG(BigInteger x, LCGParameters p) { return(BigInteger.ActualModulus(p.a * x + p.c, p.m)); }