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 8975225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:49:28+00:00 2026-06-15T18:49:28+00:00

I would like to play around with numbers and however elementary, Ive been writing

  • 0

I would like to play around with numbers and however elementary, Ive been writing algorithms for the fibonacci sequence and a brute force path for finding prime numbers!

Im not a programmer, just a math guy.

However, a problem I run into quiet often is that a long long, double and floats often run out of room.

If I wanted to continue to work in JAVA, in what way can I create my own data type so that I dont run out of room.

Conceptually, I thought to put 3 doubles together like so,

public class run {

    static double a = 0;
    static double b = 0;
    //static double c = 0;

    static void bignumber(boolean x) {

        if (x == true && a < 999999999) {
            ++a;

        } else if (x == true && a == 999999999) {
            ++b;
            a = 0;
        }
        System.out.print(b + "." + a + " \n");
    }

    public static void main(String[] args) {
        while(true) {
        bignumber(true);

        }
    }

}

is there a better way to do this,

I would like to one day be able to say

mydataType X = 18476997032117414743068356202001644030185493386634
10171471785774910651696711161249859337684305435744
58561606154457179405222971773252466096064694607124
96237204420222697567566873784275623895087646784409
33285157496578843415088475528298186726451339863364
93190808467199043187438128336350279547028265329780
29349161558118810498449083195450098483937752272570
52578591944993870073695755688436933812779613089230
39256969525326162082367649031603655137144791393234
7169566988069

or any other number found on this site

I have also tried

package main;

import java.math.BigInteger;

public class run {
    BigDecimal a = 184769970321174147430683562020019566988069;
    public static void main(String[] args) {

    }

}

But it still seems to be out of range

  • 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-15T18:49:29+00:00Added an answer on June 15, 2026 at 6:49 pm

    Use BigDecimal (instead of double), and BigInteger (instead of int, long) for that purpose, But you can only work with them by their methods. No operators, can be used.

    Used like this:

    BigInteger big = new BigInteger("4019832895734985478385764387592") // Strings...
    big.add(new BigInteger("452872468924972568924762458767527");
    

    Same with BigDecimal

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

Sidebar

Related Questions

I would like to play around with some ideas and develop a soft keyboard
i would like to allow the user to play around with the size of
I would like to play around with the Java SE version of NetBeans on
I would like to play around with testing a 3D map, of sorts. At
I would like to play around with F# on my Linux box, but I
I would like to play around in the python interpreter but with a bunch
I would like to play a sound in Objective-C with a millisecond start time.
I would like to play a video from inside the rendered page with an
I would like to play native camera shutter sound clip on camera preview capture.
I would like to play/pause video using jquery. Here is my code: (function ($)

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.