I have this code in C++
float result = -log(result)/0.5231-1.0;
And I converted that into Java code like this
float result = (float) (-Math.log(result)/0.5231-1.0);
Is this correct way to convert the c++ code?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well, the first C++ statement is illegal. You are defining
result, and while initializing you useresult.But yes, the Java code does the same as the C++ code, if we ignore the irrelevant errors.