Ejemplo n.º 1
0
        public void Min()
        {
            Vector4d v = Vector4d.One;

            v.Min(0.5f);
            Assert.AreEqual(v, new Vector4d(0.5f, 0.5f, 0.5f, 0.5f));

            v = Vector4d.One;
            v.Min(new Vector4d(0.5f, 0.5f, 0.5f, 0.5f));
            Assert.AreEqual(v, new Vector4d(0.5f, 0.5f, 0.5f, 0.5f));
        }
Ejemplo n.º 2
0
    public void Min()
    {
        for (int i = 0; i < count; i++)
        {
            float ax, ay, az, aw;
            float bx, by, bz, bw;

            ax = UnityEngine.Random.Range(-10F, 10F);
            ay = UnityEngine.Random.Range(-10F, 10F);
            az = UnityEngine.Random.Range(-10F, 10F);
            aw = UnityEngine.Random.Range(-10F, 10F);

            bx = UnityEngine.Random.Range(-10F, 10F);
            by = UnityEngine.Random.Range(-10F, 10F);
            bz = UnityEngine.Random.Range(-10F, 10F);
            bw = UnityEngine.Random.Range(-10F, 10F);

            Vector4 a = new Vector4(ax, ay, az, aw);
            Vector4 b = new Vector4(bx, by, bz, bw);

            Vector4d ad = new Vector4d(ax, ay, az, aw);
            Vector4d bd = new Vector4d(bx, by, bz, bw);

            Vector4  value  = Vector4.Min(a, b);
            Vector4d valued = Vector4d.Min(ad, bd);

            Assert.True(Approximate(value, valued));
        }
    }