On Friday 04 September 2009 15:47:06 Cactus wrote: > On Sep 4, 3:17 pm, Jason Moxham <[email protected]> wrote: > > On Friday 04 September 2009 08:33:01 Cactus wrote: > > > On Sep 4, 4:58 am, Bill Hart <[email protected]> wrote: > > > > I don't personally like the name mpz_practical_prime_p(). The reason > > > > is that it doesn't mean anything particular to anyone but us. > > > > > > I also doubt that it will help to have two differenet functions that > > > appear to do the same job to anyone who is unaware of the subtleties > > > involved. > > > > If the user has an algorithm which requires one function over the other , > > but is not aware of the difference between them , then should they really > > should not be writing anything that sophisticated. Either of the new > > functions would be better than the old one in any case. > > Nevertheless I think we should avoid names that are easily > misunderstood and I would initially take this name to mean that primes > are divided into two classes - 'practical primes' and 'impractical > primes' - and that this function returns a practical one - but still a > prime. But in fact it might not be a prime at all :-) > > If we are going to use 'probable_prime' for the one that gives > probability bounds, why not call this 'lazy' one 'mpz_likely_prime' - > this is more accurate and will at least encourage the potential user > to ask themselves what the difference between a likely and a probable > prime is (why do these have '_p' on the end anyway?). >
Ok , I couldn't really think what to call it , calling it mpz_prime_p is an abuse of the word prime. Calling it mpz_probable_prime_p also implies that it satisfies the mathematical definition of a "probable prime". As long as there is no existing definition that could be confused with it. _p on the end to match existing , indicates returned result is a "boolean" and so we dont need to call it "mpz_is_prime" but "mpz_prime_p" > > > mpz_is_composite(mpz_t n) that returns 1 if composite or 0 if the > > > test fails (compositeness undetermined). > > > > This may well be how I will implement it , with mpz_practical_prime being > > a macro on top of it. I just did it this way as that is how it is usually > > presented.Some books do point out that it would be better to call > > probable prime tests , composite tests instead. If we do the composite > > test instead then we can return more than just true or false , we could > > return a "why" , ie a trial divisor or a witness. > > That's a good additional point in favour of this solution. > > I'd still prefer the macro to be 'mpz_likely_prime' though :-) > fine by me > Brian > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "mpir-devel" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/mpir-devel?hl=en -~----------~----~----~----~------~----~------~--~---
