2

When displaying large numbers in eclipse, it just outputs nothing.

import java.math.BigInteger;

public class fibb {

    public static void main(String[] args) {
        BigInteger a = new BigInteger("-1");
        BigInteger b = new BigInteger("1");
        BigInteger c = null;
        long max = 1000000;

        long startTime = System.currentTimeMillis();
        for (long i=0; i<max; i++) {
            c = a.add(b);
            a = b;
            b = c;
//          System.out.println(c + "\n" + i + "\n");
        }
        long endTime = System.currentTimeMillis();
        System.out.println( c + "\nIt took " + (endTime - startTime) / 1000.0 + " seconds");
    }
}

This outputs a blank line, then the rest of the text "It took ..." When I ran this in the console, the number was so large that the console truncated the top of it, but it still was printed.

Is there a reason for that? Or is it just an internal bug. If you uncomment that line, eclipse stops printing the number around fibonacci of 2000.

Rüdiger Herrmann
  • 20,512
  • 11
  • 62
  • 79
Lightfire228
  • 546
  • 1
  • 5
  • 17
  • 1
    Possible duplicate of http://stackoverflow.com/questions/2828255/how-do-i-increase-the-capacity-of-the-eclipse-output-console – Rüdiger Herrmann Mar 26 '15 at 07:32
  • 1
    I looked at that. My problem is different. They want to increase how many elements are shown in the console field. My problem is that after a while, large numbers stop displaying in the console field. They don't just push the previous output out of the console, they **stop** showing up – Lightfire228 Mar 26 '15 at 15:35
  • This worked for me : https://stackoverflow.com/questions/11173698/printing-very-big-bigintegers – Eric Duminil Jan 12 '18 at 13:10

0 Answers0