Abs() 공개 메소드

public Abs ( ) : BigInteger
리턴 BigInteger
예제 #1
0
        // Like GetBitCount(Abs(x)), except 0 maps to 0
        public static int BitLength(BigInteger x) {
            if (x.IsZero()) {
                return 0;
            }

            return x.Abs().GetBitCount();
        }
예제 #2
0
 public static object Abs(BigInteger/*!*/ self) {
     return Protocols.Normalize(self.Abs());
 }
예제 #3
0
파일: LongOps.cs 프로젝트: atczyc/ironruby
 public static object __abs__(BigInteger x) {
     return x.Abs();
 }
예제 #4
0
파일: LongOps.cs 프로젝트: atczyc/ironruby
 internal static string ToBinary(BigInteger val) {            
     string res = ToBinary(val.Abs(), true, true);
     if (val.IsNegative()) {
         res = "-" + res;
     }
     return res;
 }
예제 #5
0
파일: math.cs 프로젝트: m4dc4p/ironruby
 public static double asinh(BigInteger value) {
     if (value == 0) {
         return 0;
     }
     // rewrote ln(v0 + sqrt(v0**2 + 1)) for precision
     if (value.Abs() > 1) {
         return value.Log() + Math.Log(1.0 + Complex64.Hypot(1.0, 1.0 / value));
     } else {
         return Math.Log(value + Complex64.Hypot(1.0, value));
     }
 }