For this Question: Given a number n, find the highest power of 2 that is smaller than or equal to n.The first line of the input contains the value n.

Constraints
1 <= n <= 1e18Print the highest power of 2 that is smaller than or equal to n.Sample Input 
10

Sample Output 
8
 
Explanation
8 is the highest power of 2 which is less than equal to 10, 16 is also there but it's higher than 10., I have written this Solution Code: /* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
    
    public static long log2(long N){
        long result = (long)(Math.log(N) / Math.log(2));
 
        return result;
    }
   
	public static void main (String[] args) throws java.lang.Exception
	{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        long n;
        String s = br.readLine();
        String ip[] = s.split(" ");
        n = Long.parseLong(ip[0]);
        double p = (double)log2(n);
        double x = 2;
        double res = Math.pow(x,p);
        System.out.println((long)res);
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?