Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^5: Quantum Weirdness and the Increment Operator

by ihb (Deacon)
on Jun 25, 2004 at 02:58 UTC ( #369540=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Quantum Weirdness and the Increment Operator
in thread Quantum Weirdness and the Increment Operator

For any given implementation, you can tell what will happen, because it is very unlikely to vary from what happened last time on that same implementation.

Does that even apply to the order that keys %foo return the keys of %foo?

ihb


Comment on Re^5: Quantum Weirdness and the Increment Operator
Select or Download Code
Re^6: Quantum Weirdness and the Increment Operator
by BrowserUk (Pope) on Jun 25, 2004 at 03:28 UTC

    Yes and no.

    Unless I use srand, print rand() for 1.. 100; will likely give me different output for each run of the program. So no, the output will not be the same. Yes, the output will be 100 random(ish) numbers between 0 and 1.

    The return order of keys %hash since 5.8.something is deliberately randomised, so the definition of the order is that they will be random.

    This is different to pre-5.8.something in that the order was previously "an order", that was neither random nor easily predictable, but was consistant between runs of the same program on a given build.

    The order is both defined, and explainable.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algoritm, algorithm on the code side." - tachyon

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (14)
As of 2014-09-17 12:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (74 votes), past polls