# Cant Get It To Work

• (2 Pages)
• 1
• 2

## 18 Replies - 978 Views - Last Post: 05 November 2011 - 04:55 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=254074&amp;s=e51a0007b192ceb561a4200ee1a86a94&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #16 Sheph

• D.I.C Lover

Reputation: 447
• 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

### #17 GennyBK75

Reputation: 0
• 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

### #18 Sheph

• D.I.C Lover

Reputation: 447
• 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?

### #19 pbl

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

Reputation: 8378
• 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;
}

```