nuget server logo nuget api documents
↑

API Docs / Microsoft.VisualBasic.Runtime / Modulo

Modulo

Full name Microsoft.VisualBasic.Math.SIMD.Modulo Assembly Microsoft.VisualBasic.Runtime Members 9

逐元素取余。

00 Remarks

为什么这里没有 SIMD 实现:x86/ARM 的 SIMD 指令集都没有提供逐元素的 整数除法/取余指令(除法的串行化特性使其无法被有效地向量化),浮点取余同样 没有硬件支持。因此这个类型保持标量实现 —— 强行写一个“看起来是向量化” 的版本只会比标量更慢。

为什么不使用 Math.IEEERemainder() 替换: VB 的 Mod 运算符与 IEEERemainder 在负数上的取整方向并不相同, 替换会静默改变既有调用方的数值语义。

01 Syntax

Microsoft.VisualBasic.Math.SIMD.Modulo

02 Methods

NameOverloadsSummary
f64_scalar_op_modulo_f64 1 标量对向量取余:v1 Mod v2(i)
f64_op_modulo_f64_scalar 1 向量对标量取余:v1(i) Mod v2
f64_op_modulo_f64 1 向量对向量取余:v1(i) Mod v2(i)
int32_scalar_op_modulo_int32 1 标量对向量取余(Int32)
int32_op_modulo_int32_scalar 1 向量对标量取余(Int32)
int32_op_modulo_int32 1 向量对向量取余(Int32)
int64_scalar_op_modulo_int64 1 标量对向量取余(Int64)
int64_op_modulo_int64_scalar 1 向量对标量取余(Int64)
int64_op_modulo_int64 1 向量对向量取余(Int64)

03 Members

method f64_scalar_op_modulo_f64 #
f64_scalar_op_modulo_f64(Double, Double())

标量对向量取余:v1 Mod v2(i)

method f64_op_modulo_f64_scalar #
f64_op_modulo_f64_scalar(Double(), Double)

向量对标量取余:v1(i) Mod v2

method f64_op_modulo_f64 #
f64_op_modulo_f64(Double(), Double())

向量对向量取余:v1(i) Mod v2(i)

method int32_scalar_op_modulo_int32 #
int32_scalar_op_modulo_int32(Int32, Int32())

标量对向量取余(Int32)

method int32_op_modulo_int32_scalar #
int32_op_modulo_int32_scalar(Int32(), Int32)

向量对标量取余(Int32)

method int32_op_modulo_int32 #
int32_op_modulo_int32(Int32(), Int32())

向量对向量取余(Int32)

method int64_scalar_op_modulo_int64 #
int64_scalar_op_modulo_int64(Int64, Int64())

标量对向量取余(Int64)

method int64_op_modulo_int64_scalar #
int64_op_modulo_int64_scalar(Int64(), Int64)

向量对标量取余(Int64)

method int64_op_modulo_int64 #
int64_op_modulo_int64(Int64(), Int64())

向量对向量取余(Int64)