4
$\begingroup$

Suppose you are working on something in a programming language (in my case, C++) that is math-related. Now, let's suppose that there was a numeric methods concept are having questions on, so you decide to "pull it off to the side" to write some code for that concept. Furthermore, let's suppose that the results of that program are unexpected (mathematically, you expect it to do something, but instead, it does the complete opposite). Should the question be posed here with a link to the code, and the math formulae you used in the code, and why you think the formulae should work, or should it instead be asked somewhere else (like StackOverflow)?

$\endgroup$
1
  • $\begingroup$ One key aspect is to give a minimal comprehensible excerpt of the code and to explain it well in English. On MSE, as opposed to SO, you're likely to find more people fluent in Matlab, Mathematica, and Maple than in C++. You may even find more Haskell and Coq programmers than C++ ones. So a bunch of C++-specific details will probably go over a lot of heads. That said, there are definitely people around here who speak the language and others who can get the gist of well-written code. $\endgroup$
    – dfeuer
    Jan 5 '14 at 3:11
10
$\begingroup$

My $\$.02$: If your question is a mathematical one, and not simply a syntax or a question about the language that you're using, then it's on-topic. This assumes that the primary focus is on the mathematical model, and not the program itself. So asking about unexpected results from a numerical example is perfectly fine.

For the sake of completeness and making the question self-contained, everything pertinent to the question should be included: code you're asking about, the idea of the model, the relevant formulae, and so on.

$\endgroup$
1
  • $\begingroup$ It is a mathematical question. $\endgroup$ Jan 5 '14 at 3:10
8
$\begingroup$

Such a question would be on-topic here. However, another SE site Computational Science has a higher concentration of people working on cross-disciplinary problems between mathematics and programming. Consider whether your question would be a better fit there.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .