Thanks for pointing out how to use `Pkg` to register packages. I see I 
should have found this myself. Still, I would like to define my own version 
numbering, the same way I can do it for R packages in the DESCRIPTION file.

Concerning the `Numbers` package: As I said, this was a learning 
experiment. `Base.isprime` is indeed a 100 times faster. Therefore, it 
would be reasonable to base `nextprime` and `prevprime` on repeatedly 
applying `isprime`.

`Base.gcd` and the version in `Numbers` are comparably fast. BUT: It is 
important that `gcd(a,b)` (or some variant `extgcd`) also *returns* the 
numbers `m` and `n` such that `g=m*a+n*b`. This is needed in 
number-theoretic tasks such as determining the modular inverse.

Thanks
Hans Werner


On Wednesday, January 8, 2014 2:39:47 PM UTC+1, Stefan Karpinski wrote:
>
> Good stuff! A lot of this either already exists in base Julia or should. 
> In particular, 
> primes(n)<http://docs.julialang.org/en/latest/stdlib/base/?highlight=primes#Base.primes>
>  uses 
> BitArrays and the Sieve of Atkin to quickly generate the primes up to n and 
> isprime(n)<http://docs.julialang.org/en/latest/stdlib/base/?highlight=isprime#Base.isprime>
>  uses 
> the fast Miller-Rabin primality test to check if a particular number is 
> prime. The witnesses used for the algorithm are known to be fully correct 
> for everything up to 64-bit numbers, while for larger numbers (128-bit and 
> BigInts), the algorithm is probabilistic but extremely unlikely to 
> incorrectly deem a number to be prime. See 
> base/primes.jl<https://github.com/JuliaLang/julia/blob/master/base/primes.jl>for
>  implementation details. I think 
> gcdx(a,b)<http://docs.julialang.org/en/latest/stdlib/base/?highlight=gcdx#Base.gcdx>
>  already 
> implements the extended Euclidean division algorithm, but we could probably 
> be more explicit about that in the documentation. And of course 
> factor(n)<http://docs.julialang.org/en/latest/stdlib/base/?highlight=factor#Base.factor>factors
>  a number.
>
> We could certainly incorporate the nextprime and prevprime functions, 
> although I'd want to do some research to make sure that we're using a 
> reasonably fast method. I suspect that using sieves is probably not very 
> efficient for large numbers.
>
> Regarding the package registration questions, if you do 
> Pkg.register("Numbers") and/or Pkg.tag("Numbers") and then Pkg.publish() it 
> should do all the necessary things to tag a version and submit it to the 
> METADATA repo.
>
>
> On Wed, Jan 8, 2014 at 8:06 AM, Hans W Borchers 
> <[email protected]<javascript:>
> > wrote:
>
>> Dear Julia users,
>>
>> I am using and programming Julia since a few days only.
>> For learning purposes I have set up a Julia package Numbers at
>>
>>    https://github.com/hwborchers/Numbers
>>
>> that can be installed as an unregistered package easily.
>>
>> I have two small questions here:
>>
>> (1) How can I add version numbers to packages on GitHub ?
>>
>> (2) After extending the package a bit, I would like it to become a
>>     registered package. Where would I send a request for this ?
>>
>> If you worry about the quality: It is a translation of an R package that 
>> lives
>> on CRAN for some time now. Several people have downloaded and used it.
>>
>> Best
>> Hans Werner
>>
>> P.S.:
>> I would like to thank John Myles White for starting me with some tips and
>> a good dose of encouragement.
>>
>
>

Reply via email to