"UnsignedInteger128" (编译类型)
"UnsignedInteger128" (编译类型)
"UnsignedInteger128"
表示一个无符号的 128 位机器整数原子类型说明符.
更多信息
- "UnsignedInteger128" 可用于 Typed 和相关架构以指定一个类型.
- 类型为 "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)