
-----------------------------------
AsianSensation
Wed Sep 10, 2003 7:20 pm

syntax for math operations?
-----------------------------------
how do you use mod and exponents in c++?

*mod as in modular math.

-----------------------------------
Catalyst
Wed Sep 10, 2003 7:29 pm


-----------------------------------
mod is %
and exponent is the function float pow(float num,float exp) in 
avoid pow whenever necessary it can be very very slow (i.e use x*x*x over pow(x,3))

-----------------------------------
AsianSensation
Wed Sep 10, 2003 7:33 pm


-----------------------------------
so if I want to check if a number is a divisor of another, I do this?

 
if (num % 5 == 0)
    blah blah blah


-----------------------------------
Catalyst
Wed Sep 10, 2003 7:37 pm


-----------------------------------
yup just like that

-----------------------------------
AsianSensation
Wed Sep 10, 2003 7:48 pm


-----------------------------------
cool, thanks Catalyst.

I have another question, how about the square root syntax, and does anyone know a site where I can get a list of the syntax and their uses?

-----------------------------------
Mazer
Wed Sep 10, 2003 8:03 pm


-----------------------------------
www.cppreference.com

-----------------------------------
Catalyst
Wed Sep 10, 2003 8:09 pm


-----------------------------------
Square Root is just float sqrt(float n)

heres another good site:

www.cplusplus.com

-----------------------------------
AsianSensation
Wed Sep 10, 2003 8:34 pm


-----------------------------------
cool, thanks guys.

-----------------------------------
naoki
Sat Sep 20, 2003 2:23 pm


-----------------------------------
indeed those sites will help negate the AWESOME UNQUESTIONABLE GREATNESS of my comp sci teacher

-----------------------------------
Andy
Sat Sep 20, 2003 10:21 pm


-----------------------------------
cppreference.com sux, it dont give u much info on the functions...

-----------------------------------
naoki
Sun Sep 21, 2003 12:02 pm


-----------------------------------
considering the purpose of the site and the lack of any advertisement or help to fund the site, i think cppreference is pretty damned nice to pay for its domain for the content it gives.

also try cprogramming.com and codenewbie.com

-----------------------------------
bugzpodder
Sun Sep 21, 2003 12:28 pm


-----------------------------------
cppreference.com sux, it dont give u much info on the functions...
i like cppreference, in fact i have printed out the whole website so i could use it in CCC - stupid school doesnt even have MSDN
