BitField.BitFieldTest.TestMul C# (CSharp) Method

TestMul() static private method

Mul のテスト
static private TestMul ( ulong m, ulong n ) : void
m ulong テスト入力(オペランド1)
n ulong テスト入力(オペランド2)
return void
		static void TestMul(ulong m, ulong n)
		{
			BitField a, b;
			a = BitField.Create(31, 0, m);
			b = BitField.Create(31, 0, n);

			BitField p = SampleLogic.Mul(a, b);

			ulong tmp1 = p.Value;
			ulong tmp2 = unchecked((ulong)((long)(int)a.Value * (long)(int)b.Value));

			Console.Write("{0:x8}×{1:x8} = ", (int)a.Value, (int)b.Value);
			Console.Write("{0:x16} ({1:x16})", tmp1, tmp2);

			if(tmp1 != tmp2)
			{
				Console.Write(" ** ");
				Console.ReadLine();
			}
			Console.Write("\n");
		}