On Sat, 17 Sep 2005, Hugh Sasse wrote:

> On Sat, 17 Sep 2005, Robert Klemme wrote:
>
>> Hugh Sasse wrote:
>>> On Fri, 16 Sep 2005, Robert Klemme wrote:
>>> 
>> Erm, if you want to use bit AND instead of modulo you have to use
>> different values (i.e. the modulo value us bit and value + 1):
>> 
> When I did that in my head I munged it then! (hence my comment
> above).
>> 
>> This in turn means that the modulo always must be a power of two and thus
>> is extremely unlikely to be prime.  I would even go so far as to claim
>> that the likelyhood is smaller than every nonzero positive epsilon in the
>> real numbers that you can think of.  :-)

Which, (having tested it) means my previous reply was complete
rubbish!  I was confused again.

I don't think modulo need be that expensive, because it can be

    def modulo (mod)
      if self > mod
        modulo(self - mod)
      else
        self
      end
    end

when the number and modulus are positive.  That may cost too much
chough.
         Hugh