Jump to content

All about Primes - The Prime Suite - _primes.au3 UDF lots of math functions


Recommended Posts

Posted

i updated the zip file according to the ideas in this thread.

update 23.10. _Primes.au3 v1.2 (corrected _Factorial, improved _IsPrime, _PrimeNext and PrimePrevious, corrected loop declarations)

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

  • 9 months later...
Posted (edited)

Really impressive!!!!

jennico, I've noticed that in AutoIt testing divisivility with IsInt(a/c) is faster than Mod(a,c) = 0.

You also make a division but maybe the fact that the remainder is not needed makes it faster.

For instance in your basic IsPrime function (without resorting to SPRR or Miller-Rabin) I've got this improvements just with that change:

737373737373737 improves from 16.5 secs to 13.3 secs

9007199254740881 from 57.5 secs to 46.5 secs

I've also noticed that integer limit is not 2^64, but 2^53. You can see for instance that (2^53+1) - (2^53) is ZERO, not ONE. (So the biggest direct integer prime is 2^53-111 = 9007199254740881).

Edited by Ximorro
  • 1 year later...
Posted

Love. It.

I think Im going to use this to generate Primes for my Public Cryptography Encryption.

Just wondering...How did you keep the big numbers from rolling into Sci Notation?

ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Posted

Love. It.

I think Im going to use this to generate Primes for my Public Cryptography Encryption.

Just wondering...How did you keep the big numbers from rolling into Sci Notation?

If you want to use big numbers, then the no. 1 thing to use is a library made by Eukalyptus here. Several people have tried to write bigint or bignum UDF's (myself included) but none have got anywhere near that set ;)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...