From: Yoann Guillot Date: 2006-05-10T09:58:58+09:00 Subject: Re: Exponential calcs with very large exponents On Wed, May 10, 2006 at 05:15:06AM +0900, doug meharry wrote: > for bit j = k - 2 downto 0 > begin > y = y * y mod n /* square */ > if e(j) == 1 then if e[j] == 1 > y = y * x mod n /* multiply */ > end > return y > > > Thanks for looking, > > Doug Integers in ruby has a [] method that returns the bit at the specified offset (0 for lsb) -- Yoann