Solved

How to represent ln^2(x) in Java

Posted on 2010-08-14
7
1,029 Views
Last Modified: 2012-05-10
How to represent ln^2(x) in Java?  

Math.log(x) would work for just ln(x) but how do I do ln^2(x)?
0
Comment
Question by:Midwest
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 92

Expert Comment

by:objects
Comment Utility
0
 

Author Comment

by:Midwest
Comment Utility
It is not ln(subscript(2))x it is ln^2(x).  See image.  This is different right?
img.JPG
0
 
LVL 84

Accepted Solution

by:
ozo earned 450 total points
Comment Utility
Math.log(x)*Math.log(x)
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:Midwest
Comment Utility
So, would this work?  Math.pow((Math.log(x), 2));
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
If what you need is natural log squared, then yes
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
yes
0
 
LVL 4

Assisted Solution

by:QCD
QCD earned 50 total points
Comment Utility
If by ln^2(x), you actually mean ln(ln(x)), this would be Math.log(Math.log(x))

If you mean (ln(x))^2 = ln(x) * ln(x), this would be Math.pow(Math.log(x),2), as a number of people have indicated.

The notation itself can be ambiguous.  It would help if we knew the context.

Additionally, in some contexts, log(x) is understood to be the natural log, ln(x).  In others, it is understood to be base 2, or even base 10.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Article by: Nicole
This is a research brief on the potential colonization of humans on Mars.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
This video teaches viewers about errors in exception handling.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now