|
●概要 2変数の乗除算を行い、結果をMegaLong を返す。 ●乗算 ・Mul(ByRef A As MegaLong, ByRef B As MegaLong) As MegaLong 変数の桁数によって乗算方式を自動的に選択して最適な乗算を行う。 ・LMul(ByRef A As MegaLong, ByRef B As MegaLong) As MegaLong 通常の方法で演算した A * B を返す。 ・FMul(ByRef A As MegaLong, ByRef B As MegaLong) As MegaLong FFT乗算で演算した A * B を返す。 ●除算 ・Div(ByRef A As MegaLong, ByRef B As MegaLong) As MegaLong 変数の桁数によって除算方式を自動的に選択して最適な除算を行う。 ・LDiv(ByRef A As MegaLong, ByRef B As MegaLong) As MegaLong 通常の方法で演算にした A / B を返す。 ・RDiv(ByRef A As MegaLong, ByRef B As MegaLong) As MegaLong 逆数法で演算にした A * (1 / B) を返す。 ●整数商/剰余 ・IDiv(ByRef A As MegaLong, ByRef B As MegaLong) As MegaLong A \ B (整数商)を返す。 ・Modulo(ByRef A As MegaLong, ByRef B As MegaLong) As MegaLong A Mod B (剰余)を返す。 ・IModulo(ByRef A As MegaLong, ByRef B As MegaLong, ByRef C As MegaLong) As MegaLong A \ B (整数商)を返し、 C = A Mod B (剰余)となる。商と剰余が同時に必要な場合は、こちらの方が効率的。
|