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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:58:08+00:00 2026-06-06T19:58:08+00:00

I am creating a small game for students, and in a place, it has

  • 0

I am creating a small game for students, and in a place, it has to display the value of 27830457+1

I can call BigInteger’s pow() method if the number is not this much big. Since the number is very big, that method is useless. How can I find the HUGE power of this kind of numbers? Please help!

  • 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-06T19:58:11+00:00Added an answer on June 6, 2026 at 7:58 pm

    I don’t know why you think BigInteger isn’t up to this:

    import java.math.BigInteger;
    
    public class Test {
        public static void main(String[] args) throws Exception {
            BigInteger big = BigInteger.valueOf(2)
                .pow(7830457)
                .add(BigInteger.ONE);
            System.out.println(big);
        }
    }
    

    It takes a little while (particularly the string conversion at the end), but it’s perfectly reasonable.

    As Peter noted, shifting ONE left 7830457 is much neater, mind you. I’d argue it’s a bit less clear – and of course it doesn’t help in the string conversion part.

    EDIT: Almost all of the time is spent in the string conversion. It finished in the end on my box though. I can’t see the start of it any more, but it ends with…

    08570502260645006898157834607641626568029302766491883299164453304032280181734737
    79366998940913082443120328458954436211937775477966920836932628607888755839700303
    873
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a game where i have small particles. Their number is changing
I am creating a small Yahtzee game and i have run into some regex
I'm creating a leader board (a small results table) for a Javascript game i've
I'm creating small system as prove concept. I need to configure few 5-10 call
I'm creating a small game and I have a peace of code that collects
I am creating a small game, the game is printed onto a panel on
So I am trying to learn SDL and creating a small game. When the
I'm creating a small solver that takes three arguments: number of hours, current time
I'm creating a small game, you click buttons (up, down, left and right) to
I am new to programming. I am creating a small word jumble game to

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.