Lines Matching refs:number
59 static u_long get_ulong(struct number *);
61 static __inline void push_number(struct number *);
65 static __inline struct number *pop_number(void);
85 static u_int count_digits(const struct number *);
111 static bool compare_numbers(enum bcode_compare, struct number *,
112 struct number *);
301 pn(const char *str, const struct number *n) in pn()
303 char *p = BN_bn2dec(n->number); in pn()
372 split_number(const struct number *n, BIGNUM *i, BIGNUM *f) in split_number()
376 bn_checkp(BN_copy(i, n->number)); in split_number()
398 bn_check(BN_div(i, f, n->number, a, ctx)); in split_number()
407 normalize(struct number *n, u_int s) in normalize()
410 scale_number(n->number, s - n->scale); in normalize()
415 get_ulong(struct number *n) in get_ulong()
419 return (BN_get_word(n->number)); in get_ulong()
423 negate(struct number *n) in negate()
425 BN_set_negative(n->number, !BN_is_negative(n->number)); in negate()
429 push_number(struct number *n) in push_number()
463 static __inline struct number *
576 struct number *n; in get_scale()
579 bn_check(BN_set_word(n->number, bmachine.scale)); in get_scale()
586 struct number *n; in set_scale()
591 if (BN_is_negative(n->number)) in set_scale()
607 struct number *n; in get_obase()
610 bn_check(BN_set_word(n->number, bmachine.obase)); in get_obase()
617 struct number *n; in set_obase()
634 struct number *n; in get_ibase()
637 bn_check(BN_set_word(n->number, bmachine.ibase)); in get_ibase()
644 struct number *n; in set_ibase()
662 struct number *n; in stackdepth()
667 bn_check(BN_set_word(n->number, i)); in stackdepth()
674 struct number *n; in push_scale()
691 bn_check(BN_set_word(n->number, scale)); in push_scale()
697 count_digits(const struct number *n) in count_digits()
699 struct number *int_part, *fract_part; in count_digits()
702 if (BN_is_zero(n->number)) in count_digits()
708 split_number(n, int_part->number, fract_part->number); in count_digits()
711 while (!BN_is_zero(int_part->number)) { in count_digits()
712 BN_div_word(int_part->number, 10); in count_digits()
723 struct number *n = NULL; in num_digits()
735 bn_check(BN_set_word(n->number, digits)); in num_digits()
740 bn_check(BN_set_word(n->number, digits)); in num_digits()
751 struct number *n; in to_ascii()
764 if (BN_num_bits(n->number) > 8) in to_ascii()
765 bn_check(BN_mask_bits(n->number, 8)); in to_ascii()
766 str[0] = (char)BN_get_word(n->number); in to_ascii()
802 struct number *n; in load()
812 BN_zero(n->number); in load()
875 struct number *inumber, *n; in load_array()
888 if (BN_is_negative(inumber->number)) in load_array()
897 BN_zero(n->number); in load_array()
910 struct number *inumber; in store_array()
927 if (BN_is_negative(inumber->number)) { in store_array()
966 struct number *a, *b, *r; in badd()
983 bn_check(BN_add(r->number, a->number, b->number)); in badd()
992 struct number *a, *b, *r; in bsub()
1010 bn_check(BN_sub(r->number, b->number, a->number)); in bsub()
1017 bmul_number(struct number *r, struct number *a, struct number *b, u_int scale) in bmul_number()
1028 bn_check(BN_mul(r->number, a->number, b->number, ctx)); in bmul_number()
1039 struct number *a, *b, *r; in bmul()
1061 struct number *a, *b, *r; in bdiv()
1082 struct number *a, *b, *r; in bmod()
1099 if (BN_is_zero(a->number)) in bmod()
1107 bn_check(BN_mod(r->number, b->number, a->number, ctx)); in bmod()
1118 struct number *a, *b, *frac, *quotient, *rdiv, *remainder; in bdivmod()
1140 if (BN_is_zero(a->number)) in bdivmod()
1158 bn_check(BN_div(rdiv->number, remainder->number, in bdivmod()
1159 b->number, a->number, ctx)); in bdivmod()
1163 bn_check(BN_add(quotient->number, rdiv->number, frac->number)); in bdivmod()
1177 struct number *a, *p; in bexp()
1178 struct number *r; in bexp()
1207 if (BN_is_negative(p->number)) { in bexp()
1216 b = BN_get_word(p->number); in bexp()
1224 if (BN_is_zero(p->number)) { in bexp()
1226 bn_check(BN_one(r->number)); in bexp()
1232 while (!BN_is_bit_set(p->number, 0)) { in bexp()
1235 bn_check(BN_rshift1(p->number, p->number)); in bexp()
1239 bn_check(BN_rshift1(p->number, p->number)); in bexp()
1242 while (!BN_is_zero(p->number)) { in bexp()
1245 if (BN_is_bit_set(p->number, 0)) { in bexp()
1249 bn_check(BN_rshift1(p->number, p->number)); in bexp()
1263 if (BN_is_zero(r->number)) in bexp()
1266 bn_check(BN_div(r->number, NULL, one, in bexp()
1267 r->number, ctx)); in bexp()
1298 struct number *n, *r; in bsqrt()
1307 if (BN_is_zero(n->number)) { in bsqrt()
1310 } else if (BN_is_negative(n->number)) in bsqrt()
1315 x = BN_dup(n->number); in bsqrt()
1324 bn_check(BN_div(x, NULL, n->number, x, ctx)); in bsqrt()
1332 r->number = y; in bsqrt()
1344 struct number *a; in not()
1350 bn_check(BN_set_word(a->number, BN_get_word(a->number) ? 0 : 1)); in not()
1364 struct number *a, *b, *r; in equal_numbers()
1375 bn_check(BN_set_word(r->number, in equal_numbers()
1383 struct number *a, *b, *r; in less_numbers()
1394 bn_check(BN_set_word(r->number, in less_numbers()
1402 struct number *a, *b, *r; in lesseq_numbers()
1413 bn_check(BN_set_word(r->number, in lesseq_numbers()
1475 compare_numbers(enum bcode_compare type, struct number *a, struct number *b) in compare_numbers()
1487 cmp = BN_cmp(a->number, b->number); in compare_numbers()
1512 struct number *a, *b; in compare()
1580 struct number *n; in quitN()
1603 struct number *n; in skipN()