
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
BigInteger Class in C#
Use the BigInteger to handle big numbers in C#. The assembly to add for BigInteger is System. Numerics.
In c# Big integer is found in System.Numerics.BigInteger.
Syntax
The syntax of BigInteger −
[SerializableAttribute] public struct BigInteger : IFormattable, IComparable, IComparable<BigInteger>, IEquatable<BigInteger>
Let us see an example code snippet −
BigInteger num = BigInteger.Multiply(Int64.MaxValue, Int64.MaxValue);
You can create BigInteger like this −
BigInteger num = new BigInteger(double.MaxValue);
The following are some of its constructors −
S.No. | Constructor & Description |
---|---|
1 | BigInteger(Byte[ ]) A new instance of the BigInteger structure using the values in a byte array. |
2 | BigInteger(Decimal) A new instance of the BigInteger structure using a Decimal value. |
3 | BigInteger(Double) A new instance of the BigInteger structure using a double-precision floating-point value. |
4 | BigInteger(Int32) A new instance of the BigInteger structure using a 32-bit signed integer value. |
- Related Articles
- BigInteger class in Java\n
- Multiply one BigInteger to another BigInteger in Java
- Subtract one BigInteger from another BigInteger in Java
- Divide one BigInteger from another BigInteger in Java
- Negate a BigInteger in Java
- Create BigInteger via string in Java
- Working with BigInteger Values in Java
- Math Operations on BigInteger in Java
- Shift right in a BigInteger in Java
- Shift left in a BigInteger in Java
- Create BigInteger from byte array in Java
- Performing Bitwise Operations with BigInteger in Java
- Get byte array from BigInteger in Java
- Set a bit for BigInteger in Java
- Clear a bit in a BigInteger in Java

Advertisements