# Thread: maths and c++

1. ## maths and c++

Do you need to be good at maths to become a decent programmer? I know the programming language is huge, there are many areas,, but just for the most part/in general? What areas in c++ should I avoid?

Im wondering if im wasting my time, because im quite horrible at maths. Im reading C++ Without fear, I find myself skipping a few things because I dont get prime numbers for example. Otherwise things go smoothly, I have learned variables, if / while / else, a little about loops, functions and such.

2. Originally Posted by mkeisu
I dont get prime numbers
That's easy. Just divide 19 by a number with no fractions so that you are left with a number with no fractions and you'll get it.

3. If you don't like 19, you can try 31, 63 etc which are Mersenne Primes.
...To be on topic, programming needs maths if you want to understand some underlying concepts. But if you are not really interested in these parts of programming and you can avoid them, then go on.

4. It depends on what level of math you're talking about.
If you don't know how to do elementary school math, you'd have a hard time finding any job above minimum wage.
If you were able to get through high school math, but you just don't know really advanced stuff like calculus & trigonometry, that should be fine for most programmers. The only time you'd need that level of math is if you were working on some kind of encryption or compressions algorithms, or a few other things like that.

5. No big math lessons are necessary. I doubt you'd cover things such as bases anyway, which can be quite frequently used in programming anyway. I've found mostly that only basic math skills is required for some formulas such as calculating &#37; done or such.
Have no fear. Prime numbers are evil =)

6. If Discrete math is a hurdle that is too high, then it will be a difficult road I'm afraid.

7. because im quite horrible at maths
Trying to program your maths just learned is quite a useful way to learn both.

Mathematics care about the definition of objects (functions, spaces, etc etc) and their coherence. With programming you can construct those objects. Constructing objects and play with them can really help to understand complex theorems.

8. Boolean algebra is probably the most common thing you'd use:
http://en.wikipedia.org/wiki/Boolean...ntroduction%29
I think that site makes it look a little scarier than it actually is.

9. thanks everyone

10. The good news is that most programming doesn't involve much math... And, the computer can do the calculations for you if you know how to set-up the expression.

I've been programming (mostly as a hobby) for several years, and I've never needed any calculus or other "higher math". I may have used some trigonometry, and I have done lots of "simple math", number-manipulation, and bit-manipulation.

Most beginning C++ books require very little math. You'll need to understand Boolean logic (AND, OR, NOT, XOR), which is a mathematical concept. And, you do need to know something about binary (base 2) for bitwise operations, and it also helps to know something about hexadecimal (base 16).

The bad news is that in order to become a professional programmer (or "software engineer") you will need lots of math. If you major in Computer Science in college, you will be required to take calculus just like any other science or engineering major. (I have a friend who has a job as a professional programmer, and he majored in math!)

The other bad news is that (good) programming requires logical/analytical/abstract thinking, and it requires accuracy & precision. So, people who are good at math can be good at programming, and people who are poor at math tend to have a hard time with programming.

If you really enjoy programming, you may develop new attitude toward math, and there is a good possibility of becomming much better at it!

What areas in c++ should I avoid?
I'd hate to see you "avoid" anything.... I'd rather see you "dig into" the math as-needed. cpjust mentioned encryption and compression... A couple of other math-heavy areas that come to mind are DSP (digital signal processing) and graphics, especially animation.

And most of the time, you can find a pre-written library for all of these areas. So, it's not always necessary to understand all of the math behind the functions you are using.

11. Originally Posted by DougDbug
The good news is that most programming doesn't involve much math... And, the computer can do the calculations for you if you know how to set-up the expression.

I've been programming (mostly as a hobby) for several years, and I've never needed any calculus or other "higher math". I may have used some trigonometry, and I have done lots of "simple math", number-manipulation, and bit-manipulation.

Most beginning C++ books require very little math. You'll need to understand Boolean logic (AND, OR, NOT, XOR), which is a mathematical concept. And, you do need to know something about binary (base 2) for bitwise operations, and it also helps to know something about hexadecimal (base 16).

The bad news is that in order to become a professional programmer (or "software engineer") you will need lots of math. If you major in Computer Science in college, you will be required to take calculus just like any other science or engineering major. (I have a friend who has a job as a professional programmer, and he majored in math!)

The other bad news is that (good) programming requires logical/analytical/abstract thinking, and it requires accuracy & precision. So, people who are good at math can be good at programming, and people who are poor at math tend to have a hard time with programming.

If you really enjoy programming, you may develop new attitude toward math, and there is a good possibility of becomming much better at it!

I'd hate to see you "avoid" anything.... I'd rather see you "dig into" the math as-needed. cpjust mentioned encryption and compression... A couple of other math-heavy areas that come to mind are DSP (digital signal processing) and graphics, especially animation.

And most of the time, you can find a pre-written library for all of these areas. So, it's not always necessary to understand all of the math behind the functions you are using.
very helpful reply, thanks I only want to learn it as a "hobby". I read networking in high school, but I suspect I could choose to study programming should I decide to complement my grades and study further.

Anyway, right now im only at the basics. I only wanted to know what to expect

12. For me, maths is the best way to learn programming, especially object-oriented or generic, and programming is the best way to learn maths. Think about how class inheritance and templatisation are represented mathematically, and you will learn these concepts in both domains.

When you program your mathematical classes and functions correctly, the compilation can really be equivalent to a conceptual verification of your maths. This will take some time though.

I am programming c++ for over three years now, but only since a while I have the feeling to be able to construct something. And still asking a lot of questions and making a lot of mistakes. Very probably my libraries are not the best and not fully industrial proof with scientific performance.

But it is really fun and a challenge, so invest some years in it!

Popular pages Recent additions