-4

I have a simple formula and I want to use it in C++ application. Not sure how to rewrite in C++.

enter image description here

ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97
jack
  • 1
  • 4

2 Answers2

4
logn(5, abs((a*b - d*c) / (tan(c) + sin(d))))

where logn is:

double logn(double base, double x) {
    return log(x) / log(base);
}

and the header cmath is included for the other functions.

Emil Laine
  • 41,598
  • 9
  • 101
  • 157
0

You can do this, be careful with libs, namespaces, and radian arguments

z = a*b - d*c; 
s = tan(c) + sin(d);
num = abs(z/s);
log(num)/log(5);

http://www.cplusplus.com/reference/cmath/

ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97