Im adding a specialised formula to a calculator, and it uses the Ln/ln function which is often on scientific calculators, how do i get this function to work in c++?
The formula is as follows:
'formula: pl * (10*diff + 10*creat +2*lines)
------------------------------------------
150 * (Ln(pl/1.5))'
Can anyone help?

When i have that in it gives an error saying that the log hasnt been initialised, maybe youll understand it better if you look at the code:

#include <iostream>
#include <cmath>
using namespace std;
int main()
{
char name [100];
char quit;
quit ='\0';
while (quit !='q')
{
system("title AnimeDD Power Level Calculator");
system("color 84");
float creat, diff, lines, pl, log, x, y, z; //loads integers into memory
cout <<"This is a simple power level calculator"<< endl;
cout<<"What is your characters name?"<< endl;
cin.getline (name,100);
cout<<"Hello, " << name << "."<< endl;
cout<<"Put in your current pl"<<endl;
cin>> pl;
cout<<"Put in your difficulty points:"<< endl; //asks for diff
cin>> diff; //Receives difficulty and loads it into memory
cout<<"Put in your creativity points:"<< endl;
cin>> creat;
cout<<"Put in your line count:"<< endl;
cin>> lines;
x = pl*(10*diff)+(10*creat)+(2*lines);
y = x/150*(log*(pl/1.5));
z = pl+y;
cout<<"Your Power level is " << z << ".\a" << endl;
cout<<""<< endl;
cout<<"Q - Quit"<< endl;
cout<<"R - Repeat"<< endl;
cout<<"Please type in the corresponding letter for your choice then press enter."<< endl;
cin>> quit;
cout<<"Goodbye, " << name << "."<< endl;
system("PAUSE");
system("cls");
}
return 0;
}

I removed the multiplication sign after 'log' (which made it treated like a variable instead of a function name).

Also, as you wrote it, log(pl/1.5) would have been on the top of the fraction, so I added parentheses to put it on the bottom. (Which by your original post's ASCII art I assumed you wanted.)

the probleme is that you have declared log as a float. and a float is not a function and a float variable cant be used as a function.
so ether change (150*log(pl/1.5)); to (150*std::log(pl/1.5));
or remove the log float.

Yah, it's time to get used to the idea that the natural log is called both "ln" and "log", and that the common logarithm is called "log" and "log10". For extra fun, find a teacher that writes "ln" while speaking "log"!

log(x) ; returns the natural log of x, accept it.
Are you sure that you are thinking of log?
can you give us a couple of examples of wath you want to be done?
Guessing wath you want is hard.

I have taken a closer look on your code, and think I see wher your error is.
y = x/150*(log(pl/1.5));
and
y = x/(150*(log(pl/1.5)));
are 2 completly diferent calculation. this might be your error.
and the last is the corect one, at last from your formula.

I found out why, the log was correct all along lol, the problem was in the 'x' part of the formula, i made a parenthetical error on the first line, this was my line:
x = pl*(10*diff)+(10*creat)+(2*lines);
and this is the correct version:
x = pl*((10*diff)+(10*creat)+(2*lines));
which explains why the log wasnt functioning correctly, thanks alot for your help guys ^^

I am having a trouble not knowing how to do a java code that will take user string then encrypt it using Elgamal algorithm as following
Elgamal algorithm Pseudo code: ...

A few weeks ago my laptop browsing and windows apps error. When i am on my facebook account i can watch youtube videos posted on feeds but other videos pos ...