C# में बड़ी संख्याओं को संभालने के लिए BigInteger का उपयोग करें। BigInteger के लिए असेंबली System.Numerics है।
C# में BigInteger System.Numerics.BigInteger में पाया जाता है।
सिंटैक्स
BigInteger का सिंटैक्स:
[SerializableAttribute] public struct BigInteger : IFormattable, IComparable, IComparable<BigInteger>, IEquatable<BigInteger>
कोड स्निपेट उदाहरण:
BigInteger num = BigInteger.Multiply(Int64.MaxValue, Int64.MaxValue);
आप BigInteger इस तरह बना सकते हैं:
BigInteger num = new BigInteger(double.MaxValue);
इसके कुछ कंस्ट्रक्टर्स:
| S.No. | कंस्ट्रक्टर और विवरण |
|---|---|
| 1 | BigInteger(Byte[]) बाइट ऐरे में मानों का उपयोग करके BigInteger संरचना का नया इंस्टेंस। |
| 2 | BigInteger(Decimal) Decimal मान का उपयोग करके BigInteger संरचना का नया इंस्टेंस। |
| 3 | BigInteger(Double) डबल-प्रिसिजन फ्लोटिंग-पॉइंट मान का उपयोग करके BigInteger संरचना का नया इंस्टेंस। |
| 4 | BigInteger(Int32) 32-बिट साइन्ड इंटीजर मान का उपयोग करके BigInteger संरचना का नया इंस्टेंस। |