Results 1 to 4 of 4
Thread: bigger than long
- 12-06-2009, 05:22 AM #1
Member
- Join Date
- Dec 2009
- Posts
- 2
- Rep Power
- 0
bigger than long
hey im working on new program that multiply all the numbers that lower than the input,
here the code:
when the input is around 30 the output is negativePHP Code:import java.util.*; import TerminalIO.KeyboardReader; public class count { public static void main(String[]args) { KeyboardReader input = new KeyboardReader(); int check=input.readInt("Enter number: "); long count=1; while (check>=1) { count*=check; check--; } System.out.println(count); } }
and when its 66+, its 0.
is there some thing bigger than long?
or there is other way?
- 12-06-2009, 06:28 AM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,537
- Rep Power
- 11
s there some thing bigger than long?
BigInteger
or there is other way?
Stirling's approximation
- 12-06-2009, 06:47 AM #3
Member
- Join Date
- Dec 2009
- Posts
- 2
- Rep Power
- 0
i figured it out
thanks, big integer is really usefullLast edited by scorp200; 12-06-2009 at 07:07 AM.
- 12-06-2009, 07:17 AM #4
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,537
- Rep Power
- 11
Similar Threads
-
Help with a long sorting program.
By leiferouis in forum New To JavaReplies: 12Last Post: 02-04-2009, 04:46 AM -
Long Cannot Be Dereferenced?
By caps_lock in forum New To JavaReplies: 1Last Post: 01-18-2009, 01:49 AM -
Calculate sum of long integer!
By Julingo in forum New To JavaReplies: 2Last Post: 09-09-2008, 11:50 PM -
It takes very long time.....
By iresha in forum Advanced JavaReplies: 6Last Post: 05-11-2008, 02:31 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks