• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Java question

silverpig

Lifer
A friend and I are just messing around with writing a prime number finding program. We're not trying to break any records or anything of course, but he's a math major and is interested in playing around a bit. We've come up with some decent algorithms but have a problem. Java and c++ can only do double long (I think that's right anyways) as their largest data types and we want to find primes past this limit. Apparently some custom libraries exist that allow for larger numbers, but I'm damned if I can find any for java (my friend has tried getting the c++ ones working to no avail). Anyone know where I could find something like this?

(I already looked at java.sun.com of course)
 
Those work?

I know I have java.math already, so you're telling me I could do it all along? How would I declare my test variable then? Say I wanted to set up a variable called num that was my prime candidate.

long num;

would be an example, but what would I put in it's place if I wanted it to handle insanely huge numbers?
 
Back
Top