Best practice for defining the number e

Hello! I was wondering what the best practice for defining the number [italic]e[/italic] (used in mathematics, for example, in growth and decay functions) would be in Java. Is it defined in any particular class or do you have to approximate it in a constant? Thanks very much for any help!

Comments

  • Both java.lang.Math and StrictMath libraries approximate it in a constant. This is the most accurate code for using Euler's number. I really hoped it helped you.

    public static final double E = 2.718281828459045d;


  • Both java.lang.Math and StrictMath libraries approximate it in a constant. This is the most accurate code for using Euler's number. I really hoped it helped you.

    public static final double E = 2.718281828459045d;


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion