0

Well ,I find this a very petty concern , though I'm not able to get through it. I have been through so many questions here, but no one was of exact help.

I am trying to type cast a double value to int in following way :

int res=int(Math.pow(2,3)); 

and it throws a error: '.class' expected .

Any help on this would be highly appreciated.

Thanks

4
  • What do you think int(..) does and why do you think so? Commented Oct 13, 2014 at 16:03
  • 1
    int res=(int)Math.pow(5, 6); Commented Oct 13, 2014 at 16:05
  • Math.pow(2,3) results to 8.0 , double type value. So int(Math.pow(2,3)) must result into an int type value. In fact , this is what I have found wherever I have seen. Commented Oct 14, 2014 at 7:52
  • if I'm wrong , please correct me . Thanks Commented Oct 14, 2014 at 7:53

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.