Solved

How to represent ln^2(x) in Java

Posted on 2010-08-14
7
1,137 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
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
This is about my first experience with programming Arduino.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

772 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