#### Category : logarithm

I am currently receiving this output when I run this line of code: Program received signal SIGFPE, Arithmetic exception. int number = log2 (integer value/integer value); What could be causing this? My test numbers are 128 and 134217728, i.e. log2(134217728 / 128) Source: Windows Que..

I have a range of base-10 logarithmically spaced points and I need to calculate the #points-per-decade for the points. Based on this section from wikipedia we have #decades = log10(start / stop). From this we should be able to calculate #points-per-decade as #points / #decades. However this does not give the right answer. Here is ..

I want to take the base of the logarithmic function as input from the user. Assuming base for example log10(100) can be calculated easily. What if the users are flexible to take the random base of the logarithmic function as input? [code-image] : https://i.stack.imgur.com/1QoQI.png Source: Windows Que..

Question link My code bool isPowerOfThree(int n) { if(n == 0) return false; double x = log(n)/log(3); if(x == ceil(x)) return true; return false; } Why am I getting the wrong answer for n = 243? I cout the both x and ceil(x) and both are equal. Also when I do the log10 instead of ..

What’s wrong? How to calculate the logarithm in this function? How to do input validation? How do I check for negative exponents? Why does the function exist when the logarithm is negative, but the code does not recognize it? I put restrictions on the negative logarithm, but the function for negative values ​​of the logarithm ..

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. Source: Windows Que..

hello beautiful people. I was given this question to write a c++ code to calculate the range of A if and meet in 3 points. actually using geogebra classic I figured out that it’s impossible (they meet in two points or less) but our teacher insists that it’s possible and there is a solution for ..