Arithmetic

Hi guys,

just wondered if like you have =+, == you can have *= and what exactly does it mean?

I have a function s.t.

d_hash *= (0.5*(sqrt(5)-1));
d_hash -= floor(d_hash);
d_hash *= (double)m_length;

So I assume this takes the d_hash and multiples it by this?

Thanks for your help

Ruby
x *= y

is the same as

x = x*y

Similarly for +=, -= and /=.

x == y is completely different; it is a test for equality.
thanks - I was thinking my lecturer really should just use a constant, seems excess to have all of this written down when it was a simple multiplication! My brain has gone over load clearly

Thanks again

Ruby
Topic archived. No new replies allowed.