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



Relevant Pages

  • Why Javas math expression (power) is so inconvenient and error prone?
    ... My program need a lot of calculation of power. ... The syntax is clean and easy. ... But in Java, ... Again, in many languages, ...
    (comp.lang.java.programmer)
  • Re: objects (newbie)
    ... Programming languages such as Java and C++ are object-oriented ... that can be applied in recurring software ... Design Patterns - Elements of Object-Oriented Software ...
    (comp.lang.java.help)
  • Re: size_t problems
    ... In Java, an int is a 32 bit signed value. ... other programming languages get by just fine ... The way to minimize the pain of writing 100% portable code is to write ...
    (comp.lang.c)
  • Re: Should I learn C before Java ?
    ... Should I jump right into Java, or is it better to learn ... You're right about JavaScript and Java being completely different ... whatever opinions you have on programming languages. ... discharging that responsibility. ...
    (comp.lang.java.programmer)
  • Re: JVM based languages? (mildly OT)
    ... there are other programming languages that can run in a Java Virtual ... including the z/OS Java SDK (and also in application environments ... that support Java, such as CICS Transaction Server, IMS Transaction ...
    (bit.listserv.ibm-main)