コード例 #1
0
ファイル: Fixed.cs プロジェクト: riseven/CordicSimulator
 public Fixed Resta(Fixed val)
 {
     Fixed nuevo = new Fixed();
     nuevo.valor = valor - val.valor;
     return nuevo;
 }
コード例 #2
0
ファイル: Fixed.cs プロジェクト: riseven/CordicSimulator
 public Fixed Shift(int desp)
 {
     Fixed nuevo = new Fixed();
     if (desp >= 0)
     {
         nuevo.valor = valor << desp;
     }
     else
     {
         nuevo.valor = valor >> (-desp);
         if ((valor & 1 << 31) != 0)
         {
             for (int i = 0; i < -desp; i++)
             {
                 nuevo.valor |= (uint)(1 << (31 - i));
             }
         }
     }
     return nuevo;
 }
コード例 #3
0
ファイル: Fixed.cs プロジェクト: riseven/CordicSimulator
 public Fixed Suma(Fixed val)
 {
     Fixed nuevo = new Fixed();
     nuevo.valor = valor + val.valor ;
     return nuevo ;
 }