Example #1
0
 public static Signed SignedSign(SFix number)
 {
     if (number < SFix.Zero)
     {
         return(Signed.FromInt(-1, 2));
     }
     else if (number > SFix.Zero)
     {
         return(Signed.FromInt(1, 2));
     }
     else
     {
         return(Signed.FromInt(0, 2));
     }
 }
Example #2
0
 public static Signed SignedSign(double number)
 {
     if (number < 0.0)
     {
         return(Signed.FromInt(-1, 2));
     }
     else if (number > 0.0)
     {
         return(Signed.FromInt(1, 2));
     }
     else
     {
         return(Signed.FromInt(0, 2));
     }
 }