Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: OT: Finding Factor Closest To Square Root

by Limbic~Region (Chancellor)
on Feb 28, 2005 at 19:31 UTC ( [id://435165]=note: print w/replies, xml ) Need Help??


in reply to Re^2: OT: Finding Factor Closest To Square Root
in thread OT: Finding Factor Closest To Square Root

Roy Johnson,
I am sure once you get all the bugs worked out one of your solutions will be the winner (minus my Inline::C solution). Let me know when you think it is bug free and I will update. As it stands now, it breaks on 13316184461 (45863,290347). It says that 290347 is the answer, but that is larger than the sqrt().

Cheers - L~R

  • Comment on Re^3: OT: Finding Factor Closest To Square Root

Replies are listed 'Best First'.
Re^4: OT: Finding Factor Closest To Square Root
by Roy Johnson (Monsignor) on Feb 28, 2005 at 20:12 UTC
    I had left in a call to shift that I shouldn't. It's fixed, now.

    Caution: Contents may have been coded under pressure.
      Roy Johnson,
      It's fixed, now.

      Mostly. It gives the number instead of 1 if the number is prime. That really isn't a big deal.

      $ time ./rjnew.pl real 1m8.446s user 1m1.338s sys 0m0.440s
      So you have a couple of the fastest implementations. The Inline::C is only barely winning though that might be static. The interesting thing is that many solutions are faster than using Math::Pari to get a list of factors and doing a binary search.

      Cheers - L~R

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://435165]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-04-19 13:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found