Solved

How to represent ln^2(x) in Java

Posted on 2010-08-14
7
1,175 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 450 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 50 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

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This is about my first experience with programming Arduino.
This article provides a brief introduction to tissue engineering, the process by which organs can be grown artificially. It covers the problems with organ transplants, the tissue engineering process, and the current successes and problems of the tec…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Introduction to Processes
Suggested Courses

632 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