Exemple #1
0
        private void Abs()
        {
            float[] a = new[]
            {
                -1f,
                0f,
                -0f,
                -15f,
                -2f,
                100f,
                0.1f,
                -1234f,
                -678.234f,
            };

            float[] r = new[]
            {
                1f,
                0f,
                0f,
                15f,
                2f,
                100f,
                0.1f,
                1234f,
                678.234f,
            };

            Span <float> s = stackalloc float[r.Length];

            NumericsHelpers.Abs(a, s);

            EqualsApprox(r, s);
        }
Exemple #2
0
 public BigIntegerBuilder(BigInteger bn)
 {
     _fWritable = false;
     _bits      = bn.InternalBits;
     if (_bits != null)
     {
         _iuLast = _bits.Length - 1;
         _uSmall = _bits[0];
         while (_iuLast > 0 && _bits[_iuLast] == 0)
         {
             _iuLast--;
         }
     }
     else
     {
         _iuLast = 0;
         _uSmall = NumericsHelpers.Abs(bn.InternalSign);
     }
 }