Why Java's math expression (power) is so inconvenient and error prone?



Hi,

My program need a lot of calculation of power. In many programming
languages,

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!
.



Relevant Pages

  • Re: Why Javas math expression (power) is so inconvenient and error prone?
    ... My program need a lot of calculation of power. ... But in Java, ... Again, in many languages, ... If that is still too difficult I suggestion you learn about the advantages of an Object-Oriented programming language. ...
    (comp.lang.java.programmer)
  • Why Javas math expression (power) is so inconvenient and error prone?
    ... My program need a lot of calculation of power. ... In many programming languages, ... The syntax is clean and easy. ... But in Java, ...
    (comp.lang.java.programmer)
  • Re: Basic inheritance question
    ... used 'this' in C++ and Java. ... but in Python it doesn't. ... you meant "in languages that has implicit instance reference available in methods"? ...
    (comp.lang.python)
  • Re: Looking for programming examples in any programming language
    ... in an in-page applet. ... do that for such a broad range of languages. ... But note even Java applets ... If you're going to separate the specific I/O environment from ...
    (comp.programming)
  • Re: parser
    ... and by no means is Java some obscure language... ... but I still feel that both C and C++ are good languages to use for ... leaving the backend interpreter/JIT as a simpler piece of machinery). ... that you believe that C lacks the ability to build parsers as masses of tiny ...
    (comp.programming)