Calculate the client's public value A = g^a%N
        with the generated random number a
        :param {Long integer} a Randomly generated small A.
        :return {Long integer} Computed large A.
495937
def calculate_a(self):
        
        big_a = pow(self.g, self.small_a_value, self.big_n)
        # safety check
        if (big_a % self.big_n) == 0:
            raise ValueError('Safety check for A failed')
        return big_a
1251693
function randNum (n) {
  let sNum = ''
  for (let i = 0; i < n; i++) {
    sNum += tools.rnd(0, 9)
  }
  return sNum
}
554413
function random(len) {
    if (subtle) {
        return safeRandom(len);
    } else if (nodeCrypto) {
        return new Uint8Array(nodeCrypto.randomBytes(len));
    } else {
        throw new KdbxError(Consts.ErrorCodes.NotImplemented, 'Random not implemented');
    }
}
643213
function getRandomNumber(min, max) {
  return Math.round(Math.random() * (max - min) + min);
}
248764
function (value, length, pad) {
        return _gpfToBaseANY(_gpfB16, value, {
            length: length,
            pad: pad
        });
    }
993727
private static double gSer(double x, double A) {
        // Good for X<A+1.
        double T9=1/A;
        double G=T9;
        double I=1;
        while (T9>G*0.00001) {
            T9=T9*x/(A+I);
            G=G+T9;
            ++I;
        }
        G=G*Math.exp(A*Math.log(x)-x-logGamma(A));

        return G;
    }
878196
function(value)
	{
		if (value == 'thin')
		{
			value = '2';
		}
		else if (value == 'medium')
		{
			value = '4';
		}
		else if (value == 'thick')
		{
			value = '6';
		}
		
		value = parseFloat(value);
		
		if (isNaN(value))
		{
			value = 0;
		}
		
		return value;
	}
771870
function ( safe ) {
		var s = function () { return ( ( ( 1 + Math.random() ) * 0x10000 ) | 0 ).toString( 16 ).substring( 1 ); },
		    r = [8, 9, "a", "b"],
		    o;

		o = ( s() + s() + "-" + s() + "-4" + s().substr( 0, 3 ) + "-" + r[Math.floor( Math.random() * 4 )] + s().substr( 0, 3 ) + "-" + s() + s() + s() );

		if ( safe === true ) {
			o = o.replace( /-/g, "" );
		}

		return o;
	}
945781
function get(n = 200) {
    if (!isPositiveInt(n)) return '0'; // return 0 if a valid value was not passed
    if (n === 0) return '3'; // skip calculations

    let p16 = new Decimal(1);
    let pi = new Decimal(0);

    // Check if pi value is already cached
    const cachedPI = cachePI.get('cachedPI');
    if (cachedPI) {
        pi = cachedPI; // set the value from cache
    } else {
        // Check the precision needed
        const precision = Decimal.config({}).precision;
        const one = new Decimal(1);
        const two = new Decimal(2);
        const four = new Decimal(4);
        let k8 = new Decimal(0);

        for (let k = new Decimal(0); k.lte(precision); k = k.plus(one)) {
            const f = four
                .div(k8.plus(1))
                .minus(two.div(k8.plus(4)))
                .minus(one.div(k8.plus(5)))
                .minus(one.div(k8.plus(6)));

            pi = pi.plus(p16.times(f));
            p16 = p16.div(16);
            k8 = k8.plus(8);
        }

        // Cache the original pi value here
        cachePI.set('cachedPI', pi);
    }

    // validate number of places needed
    n = n > 200 ? 200 : n;
    return pi.toPrecision(n + 2).slice(0, -1);
}
1238235
function boundAlpha(a) {
    a = parseFloat(a);

    if (isNaN(a) || a < 0 || a > 1) {
        a = 1;
    }

    return a;
}
407720
function (min, max) {
		min = (min != null ? min : 0);
		if (max == null) {
			var pow = this.exports.helpers.getPower(min) || 1;
			max = Math.pow(10, this.exports.generate.integer(pow, pow + 10));
		}
		var number = min;
		var diff = -min + max;
		if (!diff)
			return number;
		var add = Math.floor(Math.random() * Math.pow(10, this.exports.helpers.getPower(max) + 1)) % diff;
		return number + add;
	}
420908
function gaussRandom() {
  if (gaussRandom.returnV) {
    gaussRandom.returnV = false;
    return gaussRandom.vVal;
  }
  var u = 2 * Math.random() - 1;
  var v = 2 * Math.random() - 1;
  var r = u * u + v * v;
  if (r == 0 || r > 1) {
    return gaussRandom();
  }
  var c = Math.sqrt(-2 * Math.log(r) / r);
  gaussRandom.vVal = v * c; // cache this
  gaussRandom.returnV = true;
  return u * c;
}
406589
function calculateAuthKeyValue(context) {
    var ga = context.serverDHInnerData.g_a;
    var b = context.b;
    var dhPrime = context.serverDHInnerData.dh_prime;
    var authKeyValue = utility.modPow(ga, b, dhPrime);
    if (logger.isDebugEnabled()) {
        logger.debug('authKeyValue(%s) = %s', authKeyValue.length, authKeyValue.toString('hex'));
    }
    context.authKeyValue = authKeyValue;
    return context;
}
695089
function(value) {
    return Math.pow(10, Math.round((Math.log(value) / Math.LN10)) - 1);
  }
600996
private static Double convertToDouble(Object a) {

        double value;

        if (a instanceof java.lang.Double) {
            return (Double) a;
        } else if (a instanceof BigDecimal) {
            BigDecimal bd = (BigDecimal) a;

            value = bd.doubleValue();

            int        signum = bd.signum();
            BigDecimal bdd    = new BigDecimal(value + signum);

            if (bdd.compareTo(bd) != signum) {
                throw Error.error(ErrorCode.X_22003);
            }
        } else {
            value = ((Number) a).doubleValue();
        }

        return ValuePool.getDouble(Double.doubleToLongBits(value));
    }
307393
function(from, to) {
        return Math.sqrt(
            Math.pow(from.clientX - to.clientX, 2) +
            Math.pow(from.clientY - to.clientY, 2)
        );
    }
607475
function randomInteger(min, max) {
    if ((0, _is.isUndefined)(min)) {
        throw new Error('no arguments');
    }
    if ((0, _is.isUndefined)(max)) {
        max = min;
        min = 0;
    } else if (!(0, _is.isType)('integer', min) || !(0, _is.isType)('integer', max)) {
        throw new Error('arguments were not expected');
    }
    min = Number(min);
    max = Number(max);
    var difference = max - min;
    var random = Math.floor(Math.random() * (difference + 1));
    return min + random;
}