Error: invalid float literal

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 -: 2^{2} , 3^{4}) using decimal base (10^{n}).

*So, I have to convert 2 ^{p} into 10^{n} form so I have to find n in terms of p . We have x as the input.

* The formula works as below.

*2^{p} =10^{n}

*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. :confused: compiler says invalid float literal. **

System.out.println(data);

}

}

Re: Error: invalid float literal

Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.

Please post your code correctly as described at the link I've provided above. When you're asking for help with errors, copy the entire error message and stack trace exactly as it appears at your end and paste it into a post, using tags if large.

This:

data=1e(p*constant)

is not a valid Java statement, at least not with what you've shown us. What is 'le' or '1e'?