public static IxiNumber divRem(IxiNumber num1, IxiNumber num2, out IxiNumber remainder) { BigInteger bi_remainder = 0; BigInteger bi_quotient = BigInteger.DivRem(BigInteger.Multiply(num1.getAmount(), divisor), num2.getAmount(), out bi_remainder); remainder = new IxiNumber(BigInteger.Divide(bi_remainder, divisor)); return(new IxiNumber(bi_quotient)); }
public static IxiNumber subtract(IxiNumber num1, IxiNumber num2) { return(new IxiNumber(BigInteger.Subtract(num1.getAmount(), num2.getAmount()))); }
public static IxiNumber divide(IxiNumber num1, IxiNumber num2) { return(new IxiNumber(BigInteger.Divide(BigInteger.Multiply(num1.getAmount(), divisor), num2.getAmount()))); }
public static IxiNumber add(IxiNumber num1, IxiNumber num2) { return(new IxiNumber(BigInteger.Add(num1.getAmount(), num2.getAmount()))); }
public void divide(IxiNumber num) { amount = BigInteger.Divide(BigInteger.Multiply(amount, divisor), num.getAmount()); }
public void substract(IxiNumber num) { amount = BigInteger.Subtract(amount, num.getAmount()); }
public void add(IxiNumber num) { amount = BigInteger.Add(amount, num.getAmount()); }
/// <summary> /// Returns true if this wallet has no data, no public key, no multisig data nor any balance (it can be deleted from WalletState) /// </summary> /// <returns>True, if the Wallet may be safely deleted from WalletState.</returns> public bool isEmptyWallet() { return(balance.getAmount() == 0 && // if wallets have any balance they may not be deleted type == WalletType.Normal // Multisig wallets may not be deleted ); }