Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8126109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:02:56+00:00 2026-06-06T07:02:56+00:00

I’m trying to figure out the following issue related to BigIntegers in Java 7

  • 0

I’m trying to figure out the following issue related to BigIntegers in Java 7 x64. I am attempting to calculate a number to an extremely high power. Code is below, followed by a description of the problem.

import java.math.BigInteger;

public class main {

    public static void main(String[] args) {
        // Demo calculation; Desired calculation: BigInteger("4096").pow(800*600)
        BigInteger images = new BigInteger("2").pow(15544);

        System.out.println(
            "The number of possible 16 bpc color 800x600 images is: "
            + images.toString());        
    }
}

I am encountering issues printing the result of this operation. When this code executes it prints the message but not the value of images.toString().

To isolate the problem I started calculating powers of two instead of the desired calculation listed in the comment on that line. On the two systems I have tested this on, 2^15544 is the smallest calculation that triggers the problem; 2^15543 works fine.

I’m no where close to hitting the memory limit on the host systems and I don’t believe that I am even close to the VM limit (at any rate running with the VM arguments -Xmx1024M -Xms1024M has no effect).

After poking around the internet looking for answers I have come to suspect that I am hitting a limit in either BigInteger or String related to the maximum size of an array (Integer.MAX_VALUE) that those types use for internal data storage. If the problem is in String I think it would be possible to extend BigInteger and write a print method that spews out a few chars at a time until the entire BigInteger is printed, but I rather suspect that the problem lies elsewhere.

Thank you for taking the time to read my question.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:02:58+00:00Added an answer on June 6, 2026 at 7:02 am

    The problem is a bug of the Console view in Eclipse.

    On my setup, Eclipse (Helios and Juno) can’t show a single line longer than 4095 characters without CRLF. The maximum length can vary depending on your font choice – see below.

    Therefore, even the following code will show the problem – there’s no need for a BigInteger.

    StringBuilder str = new StringBuilder();
    for (int i = 0; i < 4096; i++) {
        str.append('?');
    }
    System.out.println(str);
    

    That said, the string is actually printed in the console – you can for instance copy it out of it. It is just not shown.

    As a workaround, you can set Fixed width console setting in Console preferences, the string will immediatelly appear:

    view of the pref

    The corresponding bugs on Eclipse’s bugzilla are:

    • Display problem in console when a line reaches 4096 characters
    • Texteditor can’t show a line with more than 4095 chars. Limit at 4096 chars.
    • Long lines are not displayed by editor

    According to those, it’s a Windows/GTK bug and Eclipse’s developers can’t do anything about it.

    The bug is related to the length of the text is pixels, use a smaller
    font and you will be able to get more characters in the text before it
    breaks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.