"UnsignedInteger128" (コンパイルタイプ)
"UnsignedInteger128" (コンパイルタイプ)
"UnsignedInteger128"
128ビットの符号なし機械整数原子型指定子を表す.
詳細
- "UnsignedInteger128"はTypedおよび型を指定する関連した構造で使うことができる.
- "UnsignedInteger128"型の整数は,機械整数の式よりも範囲が広く,ソフトウェア整数の式よりも速く計算を行う.
変換
- 適切な大きさのInteger式は,"UnsignedInteger128"型のコンパイルコード要素に変換することができる.
- "UnsignedInteger128"コンパイル要素はInteger式に変換することができる.
- "UnsignedInteger128"コンパイル要素は,二項算術演算で結合されると,自動的に実数要素あるいは複素数要素に昇格する.
- "UnsignedInteger128"より小さい型のコンパイル要素は,二項算術演算で結合されると,自動的に"UnsignedInteger128"に昇格する.
- "Integer128"コンパイル要素は,二項算術演算で結合されると,自動的に"UnsignedInteger128"要素に昇格する.
式から
式へ
算術演算
例題
例 (4)
"UnsignedInteger128"は入力およびCompiledCodeFunctionの出力として使うことができる:
cf = FunctionCompile[Function[Typed[arg, "UnsignedInteger128"], arg]]cf[ 100]関数を実行している間に,オーバーフローによりエラーが生じる.計算は終了され,メッセージが出力される.結果を計算するためにWolfram Engineが使われる:
cf = FunctionCompile[Function[Typed[arg, "UnsignedInteger128"], arg ^ arg]];
cf[2^6]"UnsignedInteger128"引数は,実数と組み合されると自動的に昇格する:
cf = FunctionCompile[Function[{Typed[arg1, "UnsignedInteger128"], Typed[arg2, "Real64"]}, arg1 + arg2]];
Information[cf, "Signature"]"UnsignedInteger128"引数がストレージサイズの小さい整数と組み合されると,小さい方の型は自動的に昇格する:
cf = FunctionCompile[Function[{Typed[arg1, "UnsignedInteger128"], Typed[arg2, "Integer8"]}, arg1 + arg2]];
Information[cf, "Signature"]同じストレージサイズの符号付き整数が"UnsignedInteger128"と組み合されると,自動的に昇格する:
cf = FunctionCompile[Function[{Typed[arg1, "Integer128"], Typed[arg2, "UnsignedInteger128"]}, arg1 + arg2]];
Information[cf, "Signature"]"UnsignedInteger128"を使った計算は機械整数の式の大きさを超えた整数を扱うことができる:
cf = FunctionCompile[Function[{Typed[arg1, "UnsignedInteger128"], Typed[arg2, "UnsignedInteger128"]}, arg1 * arg2]];
cf[2^60, 2^60]Developer`MachineIntegerQ[%]テクニカルノート
履歴
2021 で導入 (12.3)