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

Re: covariance calculation

by amir_e_a (Hermit)
on Dec 28, 2009 at 18:54 UTC ( #814650=note: print w/replies, xml ) Need Help??

in reply to covariance calculation

What the other monks answered is correct, and here's a little addition:

The names of the variables $arraylref and $array2ref are hints that both of them are supposed to be references to arrays. \@sales is an array reference: the @ stands for "array" and \ stands for "reference". @hits, on the other hand, is just an array, not a reference.

Of course, you can't always count on variable names to hint at what they are supposed to be, but in this case it is correct.

Another hint that both of these variables really need to be references is the usage of the arrow operator -> in the line

$arraylref->[$i] * $array2ref->[$i];

The arrow operator is only used with references.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2023-04-02 08:05 GMT
Find Nodes?
    Voting Booth?

    No recent polls found