Why Java's math expression (power) is so inconvenient and error prone?
- From: Shawn <shaw@xxxxxxxxxx>
- Date: Mon, 30 Oct 2006 14:02:15 -0500
Hi,
My program need a lot of calculation of power. In many programming languages,
2**3 = 8; //or
2^3 = 8;
The syntax is clean and easy. But in Java,
Math.pow(2, 3) = 8; //It is so long, and complicated and error prone
Again, in many languages,
EXP(1) = 2.7 //e value
But in Java,
Math.pow(Math.E, 1) = 2.7 //You see, so complicated
Normally, in one calculation, 2**3 or EXP(3.5) is only part of expression, like "a + b**3 + EXP(-a)". In Java, it will be very long and error prone!
.
- Follow-Ups:
- Prev by Date: Re: Can I restart a jsp session from a javascript?
- Next by Date: Why Java's math expression (power) is so inconvenient and error prone?
- Previous by thread: Need help in my code
- Next by thread: Re: Why Java's math expression (power) is so inconvenient and error prone?
- Index(es):
Relevant Pages
|