*
The moose likes Beginning Java and the fly likes Help! Math question. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help! Math question." Watch "Help! Math question." New topic
Author

Help! Math question.

Joe Budden
Greenhorn

Joined: Mar 22, 2006
Posts: 2
I have a question, given the following code:



Why is the output the same of:
0.3989423
0.3989423

All help appreciated. Thank you.
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
Math.exp((-1/2) * (.01 * .01))


Remember that when you divide an int by an int, the result is an int. The operations in parentheses are done seperately.

Since -1/2 is 0, the result will be e^0 = 1 regardless of what you multiply -1/2 by.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help! Math question.
 
Similar Threads
calculator program help please
Digital Signal Processing (DSP, FFT, Spectrum)
Dan's exam class SRC108
Math.sqrt()
Problem with my application never exiting the main