cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Arithmetic
Arithmetic
Feb 11, 2012 at 7:25pm UTC
redrubia
(11)
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
Feb 11, 2012 at 7:32pm UTC
Moschops
(7244)
x *= y
is the same as
x = x*y
Similarly for +=, -= and /=.
x == y is completely different; it is a test for equality.
Feb 11, 2012 at 8:46pm UTC
redrubia
(11)
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.