Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by sleepingsquirrel (Hermit)
on Feb 19, 2005 at 16:03 UTC ( #432737=note: print w/ replies, xml ) Need Help??


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

Maybe I don't understand the OP's requirements, but 36 isn't a factor of 996 (996/36 = 27.666...). I'm guessing he wants 12 (3*2*2) for that case. And 32 isn't a factor of 1000, but 25 is. etc. Am I missing something?


-- All code is 100% tested and functional unless otherwise noted.


Comment on Re^2: OT: Finding Factor Closest To Square Root
Replies are listed 'Best First'.
Re^3: OT: Finding Factor Closest To Square Root
by BrowserUk (Pope) on Feb 19, 2005 at 16:12 UTC
    Am I missing something?

    Nope. Nothing at all.

    Your just witnessing me loosing sight of the OP's requirements whilst getting caught up with the mechnics of the code. :(


    Examine what is said, not who speaks.
    Silence betokens consent.
    Love the truth but pardon error.
Re^3: OT: Finding Factor Closest To Square Root
by BrowserUk (Pope) on Feb 19, 2005 at 16:35 UTC

    I updated 432636. Does the new version look any better?

    That's the problem with hueristics--how do you validate them?


    Examine what is said, not who speaks.
    Silence betokens consent.
    Love the truth but pardon error.
      For the case of 1994, I'd say 2 is closer to 44.65... than 997. For 1993, I'd probably go with 1 over 1e99 or 1993. For 99999999, I think 9999 (101*11*3*3) is closest. (I'm just basing this on the comments after the __END__ tag in your code, 'cause I'm to lazy to install Math::Big::Factor)


      -- All code is 100% tested and functional unless otherwise noted.
        , 'cause I'm to lazy to install Math::Big::Factor

        I think that Math::Big::Factor may be a red-herring anyway. See Re: OT: Finding Factor Closest To Square Root.


        Examine what is said, not who speaks.
        Silence betokens consent.
        Love the truth but pardon error.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (18)
As of 2015-07-28 15:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (257 votes), past polls