Home c++ How to take a logarithm based on E?

How to take a logarithm based on E? [Duplicate]




How in C++ take logarithm based on E?

Answer 1, Authority 100%

Standard suitable Std :: Log ?


Now and with an example.

We add at the top of the include list #include & lt; Cmath & gt; .

In the right place we use

double x = 10.0;
Double LX = STD :: LOG (X); // counted
STD :: COUT & LT; & LT; "log (x) =" & lt; & lt; LX & LT; & LT; '\ n'; // Printed "log (x) = 2.30259"

Answer 2, Authority 25%

Use the STD :: Log function from the CMATH library.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions