Cant Get It To Work

  • (2 Pages)
  • +
  • 1
  • 2

18 Replies - 978 Views - Last Post: 05 November 2011 - 04:55 PM Rate Topic: -----

#16 Sheph  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 447
  • View blog
  • Posts: 1,032
  • Joined: 12-October 11

Re: Cant Get It To Work

Posted 05 November 2011 - 04:08 PM

integer goes up to 20,000

for (int i = 0; i <= 20000; i++) {
     // calculate 2^i the problem here is that long's max value is 2^64, or well (2^32)-1 I guess. I don't know how you could do that.
}

This post has been edited by Sheph: 05 November 2011 - 04:16 PM

Was This Post Helpful? 0
  • +
  • -

#17 GennyBK75  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 23-October 11

Re: Cant Get It To Work

Posted 05 November 2011 - 04:13 PM

Nm I got it to work
Was This Post Helpful? 0
  • +
  • -

#18 Sheph  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 447
  • View blog
  • Posts: 1,032
  • Joined: 12-October 11

Re: Cant Get It To Work

Posted 05 November 2011 - 04:15 PM

Would you care to show us your solution?
Was This Post Helpful? 0
  • +
  • -

#19 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8378
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: Cant Get It To Work

Posted 05 November 2011 - 04:55 PM

20000 will fit within a int
		int power = 2;
		while(power <= 20000) {
			System.out.println(power);
		    power *= 2;
		}


Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2