Lines Matching refs:mpz

62         #error cannot encode MP_SSIZE_MAX as mpz
80 mpz_init_zero(&o->mpz); in mp_obj_int_new_mpz()
98 size_t needed_size = mp_int_format_size(mpz_max_num_bits(&self->mpz), base, prefix, comma); in mp_obj_int_formatted_impl()
105 *fmt_size = mpz_as_str_inpl(&self->mpz, base, prefix, base_char, comma, str); in mp_obj_int_formatted_impl()
112 mpz_set_from_bytes(&o->mpz, big_endian, len, buf); in mp_obj_int_from_bytes_impl()
119 mpz_as_bytes(&self->mpz, big_endian, len, buf); in mp_obj_int_to_bytes_impl()
134 if (self->mpz.len == 0) { in mp_obj_int_sign()
136 } else if (self->mpz.neg == 0) { in mp_obj_int_sign()
147 return mp_obj_new_bool(!mpz_is_zero(&o->mpz)); in mp_obj_int_unary_op()
149 return MP_OBJ_NEW_SMALL_INT(mpz_hash(&o->mpz)); in mp_obj_int_unary_op()
153 mpz_neg_inpl(&o2->mpz, &o->mpz); in mp_obj_int_unary_op()
157 mpz_not_inpl(&o2->mpz, &o->mpz); in mp_obj_int_unary_op()
162 if (self->mpz.neg == 0) { in mp_obj_int_unary_op()
166 mpz_abs_inpl(&self2->mpz, &self->mpz); in mp_obj_int_unary_op()
186 zlhs = &((mp_obj_int_t *)MP_OBJ_TO_PTR(lhs_in))->mpz; in mp_obj_int_binary_op()
194 zrhs = &((mp_obj_int_t *)MP_OBJ_TO_PTR(rhs_in))->mpz; in mp_obj_int_binary_op()
225 mpz_add_inpl(&res->mpz, zlhs, zrhs); in mp_obj_int_binary_op()
229 mpz_sub_inpl(&res->mpz, zlhs, zrhs); in mp_obj_int_binary_op()
233 mpz_mul_inpl(&res->mpz, zlhs, zrhs); in mp_obj_int_binary_op()
243 mpz_divmod_inpl(&res->mpz, &rem, zlhs, zrhs); in mp_obj_int_binary_op()
254 mpz_divmod_inpl(&quo, &res->mpz, zlhs, zrhs); in mp_obj_int_binary_op()
261 mpz_and_inpl(&res->mpz, zlhs, zrhs); in mp_obj_int_binary_op()
265 mpz_or_inpl(&res->mpz, zlhs, zrhs); in mp_obj_int_binary_op()
269 mpz_xor_inpl(&res->mpz, zlhs, zrhs); in mp_obj_int_binary_op()
281 mpz_shl_inpl(&res->mpz, zlhs, irhs); in mp_obj_int_binary_op()
283 mpz_shr_inpl(&res->mpz, zlhs, irhs); in mp_obj_int_binary_op()
297 mpz_pow_inpl(&res->mpz, zlhs, zrhs); in mp_obj_int_binary_op()
306 mpz_divmod_inpl(&quo->mpz, &res->mpz, zlhs, zrhs); in mp_obj_int_binary_op()
341 return &(arp_p->mpz); in mp_mpz_for_int()
357 mpz_pow3_inpl(&(res_p->mpz), lhs, rhs, mod); in mp_obj_int_pow3()
382 mpz_set_from_ll(&o->mpz, val, true); in mp_obj_new_int_from_ll()
388 mpz_set_from_ll(&o->mpz, val, false); in mp_obj_new_int_from_ull()
403 size_t n = mpz_set_from_str(&o->mpz, *str, len, neg, base); in mp_obj_new_int_from_str_len()
414 return mpz_hash(&self->mpz); in mp_obj_int_get_truncated()
424 if (mpz_as_int_checked(&self->mpz, &value)) { in mp_obj_int_get_checked()
441 if (mpz_as_uint_checked(&self->mpz, &value)) { in mp_obj_int_get_uint_checked()
453 return mpz_as_float(&self->mpz); in mp_obj_int_as_float_impl()