Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I can't search what does the logarithm code look like in C++? What the code of the logarithm function looks like in C++ in the library cmath? Exactly the code. I don't need to figure out how I can get the logarithm. I want to know how this algorithm works.
You would be very disappointed. On modern processors, the C++ compiler inserts the assembly instruction that obtains it from the floating-point ALU. There is no code.
That is implementation specific and therefore can vary from system to system.
Since there are several ways to compute a logarithm, a good book on this kind of algorithm is a good start.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
What is a general way to look at LLVM and find the corresponding calls in the C++ API?
For example, I have the logical and instruction which corresponds to the Language reference here.
How can I find a corresponding C++ API reference? My general approach would be to put "llvm add instruction C++ API" into a search engine, but this isn't consistently useful.
Usually for an someinst instruction there is a SomeInstInst class. For instance, alloca is implemented by AllocaInst.
But not for add, that's what confused you. Binary arithmetic and logical instructions are implemented using single class called BinaryOperator.
Another exception is a phi instruction - it is implemented in the PHINode class. Other than that, figuring what class you need should be pretty straightforward.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Is there a tool that converts C++ code into fortran? Please state any possible deficiency of the tool you use.
I know it sounds silly but I do have a C++ code that calls a big Fortran code inside and I need to to use OpenMP. I am trying to keep the parallel region only inside Fortran (because there are many COMMON blocks and EQUIVALENCEs used) so I have to translate a few hundreds of lines of C++ functions to Fortran.
Depending on the compiler (such as the GNU compilers), you're actually able to compile C, C++, Fortran, etc. code together. This is so you don't actually have to translate or rewrite that code. C++ Forum Answer
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I am looking for a way to enforce adding comments for code blocks inside functions. for example I want each for loop, if condition etc. to have one or two lines of comments describing what the code actually does.
I know Doxygen and I know it is not capable of doing this task. is there any other tool that can be used to give some information/metrics about the quality and amount of comments in function implementation?
What could be interesting is to search for methods with a high cyclomatic complexity(using many if,for,while,..) and not well commented, for that you can use CppDepend and execute a CQLinq request like this one:
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
How might one implement data frame in R, Python, and other languages using C++?
In general, data.frame solves a problem which is solved fundamentally differently in C++ (and other languages) – namely via class hierarchies, or, in the simplest case, via a vector of tuples.
Since you haven’t given specifics it’s hard to know what exactly you are after but if it’s ease of computation, Armadillo is a good linear algebra library for C++ (one among many). I haven’t yet found a good statistics framework for C++ – I suggest simply sticking with R for that.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I have an arbitrary expression in a string. Let's say:
y=12*x+34
I will have x or y and I need to solve for the other.
muParser does a brilliant job of solving the first form given x but it and all the other math parsers I've found cannot perform any sort of manipulation to turn the expression into:
x=(y-34)/12 so the other could be solved if I had y instead of x.
Is there a C/C++ library out there that isn't GNU encumbered that can be used to solve this?
It looks like you want to embed a proper CAS. Try GiNaC, if it is not powerful enough, think of embedding Maxima or Axiom (both are very heavyweight and runs on top of Common Lisp).