Lines Matching defs:den

509 mpi_div(mpi *rop, mpi *num, mpi *den)
511 mpi_divqr(rop, NULL, num, den);
515 mpi_rem(mpi *rop, mpi *num, mpi *den)
517 mpi_divqr(NULL, rop, num, den);
525 mpi_divqr(mpi *qrop, mpi *rrop, mpi *num, mpi *den)
542 qsign = rsign ^ den->sign;
545 if (num->size < den->size) {
563 rsize = den->size;
564 qsize = num->size - den->size + 1;
568 dpos = den->size - 1;
571 if (qrop == NULL || qrop->digs == num->digs || qrop->digs == den->digs)
582 if (rrop->digs == num->digs || rrop->digs == den->digs)
600 qdigs[i] = (BNS)(value / den->digs[0]);
601 carry = (BNS)(value % den->digs[0]);
617 denorm = (BNS)((BNI)CARRY / ((BNI)(den->digs[dpos]) + 1));
627 ddigs = mp_malloc(sizeof(BNS) * den->size);
628 memcpy(ddigs, den->digs, sizeof(BNS) * den->size);
629 for (carry = 0, i = 0; i < den->size; i++) {
637 ddigs = den->digs;
656 for (i = 0; i < den->size; i++) {
672 for (i = 0; i < den->size; i++) {
693 if (ddigs != den->digs)
741 mpi_divqri(mpi *qrop, mpi *num, long den)
748 _mpi_seti(&dop, den);
764 mpi_divi(mpi *rop, mpi *num, long den)
770 _mpi_seti(&dop, den);
776 mpi_remi(mpi *num, long den)
778 return (mpi_divqri(NULL, num, den));
782 mpi_mod(mpi *rop, mpi *num, mpi *den)
784 mpi_rem(rop, num, den);
785 if (num->sign ^ den->sign)
786 mpi_add(rop, rop, den);
790 mpi_modi(mpi *num, long den)
794 remainder = mpi_remi(num, den);
795 if (num->sign ^ (den < 0))
796 remainder += den;
802 mpi_gcd(mpi *rop, mpi *num, mpi *den)
808 cmp = mpi_cmpabs(num, den);
810 /* check if num is equal to den or if num is zero */
812 mpi_set(rop, den);
816 /* check if den is not zero */
817 if (den->size == 1 && den->digs[0] == 0) {
826 /* if num larger than den */
828 mpi_rem(&rem, num, den);
831 mpi_set(rop, den);
836 mpi_set(rop, den);
839 mpi_rem(&rem, den, num);
868 mpi_lcm(mpi *rop, mpi *num, mpi *den)
874 (den->size == 1 && den->digs[0] == 0)) {
883 mpi_gcd(&gcd, num, den);
884 mpi_div(&gcd, den, &gcd);