示例#1
0
        void Lcm()
        {
            Assert.Equal(6, MathX.Lcm(6, 6));
            Assert.Equal(6, MathX.Lcm(2, 3));
            Assert.Equal(36, MathX.Lcm(12, 18));
            Assert.Equal(36, MathX.Lcm(18, 12));

            //Assert.Throws<OverflowException>(() => MathX.Lcm(1000000007, 1000000009));

            //0以下は未定義
            Assert.Equal(0, MathX.Lcm(0, 114));
            Assert.Equal(0, MathX.Lcm(514, 0));
            Assert.Throws <DivideByZeroException>(() => MathX.Lcm(0, 0));
        }