// Like GetBitCount(Abs(x)), except 0 maps to 0 public static int BitLength(BigInteger x) { if (x.IsZero()) { return 0; } return x.Abs().GetBitCount(); }
public static object Abs(BigInteger/*!*/ self) { return Protocols.Normalize(self.Abs()); }
public static object __abs__(BigInteger x) { return x.Abs(); }
internal static string ToBinary(BigInteger val) { string res = ToBinary(val.Abs(), true, true); if (val.IsNegative()) { res = "-" + res; } return res; }
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)); } }