Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Semrush - keyword research tool

Create your online store today with Shopify

Turn ChatGPT, Claude, Gemini, And CoPilot Into Your Personal Assistant, Business Coach, Content Creator, And More

AFFILIATE MARKETING Your all-in-one performance engine Manage affiliates, creators, and customer referrals in one unified platform—turning every partnership into measurable growth

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Disclosure: My content contains affiliate links.

43,239 questions

56,142 answers

573 users

How to calculate power for large numbers using WinForms in C#

1 Answer

0 votes
using System.Numerics;

namespace WinFormsApp1
{
    public partial class Form1 : Form
    {
        public static BigInteger PowerBigInteger(int baseValue, int exponent)
        {
            return BigInteger.Pow(new BigInteger(baseValue), exponent);
        }
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int baseValue = 2, exponent = 15;
            MessageBox.Show("2^15 = " + PowerBigInteger(baseValue, exponent));

            baseValue = 2; exponent = 100;
            MessageBox.Show("2^100 = " + PowerBigInteger(baseValue, exponent));

        }
    }
}


/*
run:
 
2^15 = 32768
2^100 = 1267650600228229401496703205376

*/

 



answered Aug 2, 2025 by avibootz

Related questions

1 answer 160 views
1 answer 124 views
1 answer 127 views
1 answer 145 views
1 answer 144 views
...