C#
 Computer >> コンピューター >  >> プログラミング >> C#

C#のBigIntegerクラス


BigIntegerを使用して、C#で大きな数値を処理します。 BigIntegerに追加するアセンブリはシステムです。数値。

C#では、大きな整数は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構造の新しいインスタンス。

  1. オブジェクトがJavaScriptのクラスのインスタンスであるかどうかを確認するにはどうすればよいですか?

    以下は、オブジェクトがJavaScriptのクラスのインスタンスであるかどうかを確認するためのコードです- 例 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title>

  2. C#のコンソールクラス

    C#のConsoleクラスは、コンソールアプリケーションの標準の入力、出力、およびエラーストリームを表すために使用されます。 C#のコンソールクラスプロパティの例をいくつか見てみましょう- Console.CursorLeftプロパティ C#でコンソールのCursorLeftを変更するには、Console.CursorLeftプロパティを使用します。 例 例を見てみましょう- using System; class Demo {    public static void Main (string[] args) {       Cons