Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cross platform performance



On 12/13/04 11:48 AM, "Mike Hall" <email@hidden> wrote:

> started looking at this with java and BigInteger since the main interest in
> primes these days, along the lines of RSA crypto, seems to be how big can you
> find primes and/or factor the product of two of them.
> Right off I seemed to need square root which is lacking in BigInteger.

If I you just need the square root to be able to determine
if (n1 < sqrt(n2))
you could instead change to:
if ((n1 * n1) < n2)
and this is probably a lot faster than using any square root function.

-- 
Cameron Hayne (email@hidden)
Hayne of Tintagel

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Cross platform performance (From: "Mike Hall" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.