Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to represent ln^2(x) in Java

Posted on 2010-08-14
7
Medium Priority
?
1,217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 92

Expert Comment

by:objects
ID: 33439239
0
 

Author Comment

by:Midwest
ID: 33439251
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 1800 total points
ID: 33439262
Math.log(x)*Math.log(x)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

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

Expert Comment

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

Expert Comment

by:ozo
ID: 33439302
yes
0
 
LVL 4

Assisted Solution

by:QCD
QCD earned 200 total points
ID: 33439566
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
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.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

730 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