N
netmasker
Hello,
I am trying to do the following operation:
ln(0.2) / (3/60)
or in java:
float aaa = (float) ( - Math.log(.2) / (3/60) ) ;
System.out.println(aaa);
but the result I take is "Infinity".
I tried to format the logarithm operation like this:
java.text.DecimalFormat df = new java.text.DecimalFormat("###.###");
String str = df.format(- Math.log(.2) );
but then it is converted to a String and the following command
produces an error.
float fff = (float) Float.parseFloat(str);
Rounding does not work for me either.
The result is successfully computed by the calculator and is:
-32,188758248682007492015186664524
But how can I make this operation in java??
Thanks in advance
I am trying to do the following operation:
ln(0.2) / (3/60)
or in java:
float aaa = (float) ( - Math.log(.2) / (3/60) ) ;
System.out.println(aaa);
but the result I take is "Infinity".
I tried to format the logarithm operation like this:
java.text.DecimalFormat df = new java.text.DecimalFormat("###.###");
String str = df.format(- Math.log(.2) );
but then it is converted to a String and the following command
produces an error.
float fff = (float) Float.parseFloat(str);
Rounding does not work for me either.
The result is successfully computed by the calculator and is:
-32,188758248682007492015186664524
But how can I make this operation in java??
Thanks in advance