Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^2: Zeckendorf representation

by thmsdrew (Scribe)
on Aug 25, 2012 at 03:11 UTC ( #989683=note: print w/ replies, xml ) Need Help??

in reply to Re: Zeckendorf representation
in thread Zeckendorf representation

Thanks for your input! What do you mean by "short circuit"? Also, the difference between your is_perfect_square sub and mine is that mine is much more clear. I can afford the extra line for a bit of clarity.

Comment on Re^2: Zeckendorf representation
Replies are listed 'Best First'.
Re^3: Zeckendorf representation
by lidden (Curate) on Aug 25, 2012 at 03:59 UTC
    What do you mean by "short circuit"?
    It means that the part after || will only be evaluated if it is needed know the result of the operator. In the case of the or-operator the second half is redundant if the first is true, since the total will be true no matter what the second part is.

      I don't really understand how that is a problem. If the first part passes, then I want it to return true, and I truly don't care what the second part is. I guess I see how that's redundant, though.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2015-10-13 07:16 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (296 votes), past polls