Hi people,
This is my very first post in this site. While doing trial and error got caught in the below scenario.
public class Crypt {
public static void main (String args[])
{
/*all I want is calculate a binary number (ex -: 22 , 34) using decimal base (10n).
*So, I have to convert 2 p into 10n form so I have to find n in terms of p . We have x as the input.
* The formula works as below.
*2p =10n
*p ln (2) =n ln (10)
*n = p [ln(2) / ln(10)]
*2 p = 10 p [ln(2) / ln(10)]
*/
double constant=(Math.log(2)/Math.log(10));
// for the sake of readability removed some piece of repititive execution
int p=4; // the power of 2
double data=1e(p*constant); // data is the Pth power of 2
// compiltion stops by this point.
compiler says invalid float literal.compiler says invalid float literal.
System.out.println(data);
}
}