23.11.2017 Views

java_tutorial

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Java<br />

Example<br />

public class Test{<br />

public static void main(String args[]){<br />

double x = 11.635;<br />

double y = 2.76;<br />

}<br />

}<br />

System.out.printf("The value of e is %.4f%n", Math.E);<br />

System.out.printf("exp(%.3f) is %.3f%n", x, Math.exp(x));<br />

This will produce the following result:<br />

The value of e is 2.7183<br />

exp(11.635) is 112983.831<br />

Java – log() Method<br />

Description<br />

The method returns the natural logarithm of the argument.<br />

Syntax<br />

double log(double d)<br />

Parameters<br />

Here is the detail of parameters:<br />

<br />

d -- Any primitive data type.<br />

Return Value<br />

<br />

This method returns the natural logarithm of the argument.<br />

101

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!