Computer Science Canada too big numbers |
Author: | cool dude [ Tue Jun 13, 2006 7:31 pm ] | ||
Post subject: | too big numbers | ||
a question that i'm doing is this: Quote: Problem 20 n! means n × (n − 1) × ... × 3 × 2 × 1 Find the sum of the digits in the number 100! the problem with this is that the sum is too big(unless i did something wrong) thus it keeps displaying 0. is there any way to fix that?
|
Author: | wtd [ Tue Jun 13, 2006 9:09 pm ] |
Post subject: | |
BigInteger |
Author: | cool dude [ Tue Jun 13, 2006 10:21 pm ] |
Post subject: | |
i'm running into too many problems with BigInteger because i don't really know how to use it. i tried it and then it said i can't use operators with BigInteger ![]() |
Author: | codemage [ Wed Jun 14, 2006 8:46 am ] |
Post subject: | |
BigInteger is a class, so it doesn't work the same way that integer primitives do. See the methods here for common operations: http://java.sun.com/j2se/1.4.2/docs/api/java/math/BigInteger.html |
Author: | [Gandalf] [ Wed Jun 14, 2006 6:10 pm ] |
Post subject: | |
Why link to the Java 1.4.2 documentation? Whenever possible, you should be using the most modern version of documentation/code. Here's the 5.0 documentation for BigInteger: http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigInteger.html |