16namespace layer1_foundations {
17namespace ring_theory {
39 cout <<
"longinteger_object::freeself ";
50 cout <<
"longinteger_object::freeself" << endl;
77 cout <<
"longinteger_object::create "
78 "i=" << i <<
" log = " << l << endl;
89 cout <<
"longinteger_object::create "
90 "i=" << ii <<
" created ";
93 cout <<
" with j=" << j <<
" digits" << endl;
112 for (i = 0; i < e; i++) {
129 A.
create(-1, __FILE__, __LINE__);
131 for (i = 0; i < e; i++) {
142 int b,
int *rep,
int len)
149 bb.
create(b, __FILE__, __LINE__);
150 for (i =
len - 1; i >= 0; i--) {
159 const char *str,
int verbose_level)
161 int f_v = (verbose_level >= 1);
168 bb.
create(10, __FILE__, __LINE__);
169 for (i =
len - 1; i >= 0; i--) {
171 y.
create(str[
len - 1 - i] -
'0', __FILE__, __LINE__);
175 cout <<
"longinteger_object::create_from_base_10_string "
176 "str = " << str << endl;
177 cout <<
"object = " << x << endl;
196 for (i = l - 1; i >= 0; i--) {
211 for (i = l - 1; i >= 0; i--) {
227 cout <<
"longinteger_object::assign_to "
228 "before b.freeself" << endl;
230 cout <<
"this is what we free: ";
238 cout <<
"longinteger_object::assign_to "
239 "after b.freeself" << endl;
244 for (i = 0; i < l; i++) {
248 cout <<
"after assign: ";
252 cout <<
"longinteger_object::assign_to done" << endl;
285 for (i = l - 1; i >= 0; i--) {
295 ost <<
" = " << c1 <<
"." << c2 <<
" x 10^" << l - 1;
314 for (i = l - 1; i >= 0; i--) {
349 for (i = 0; i <
len; i++) {
358 for (i = 0; i <
len; i++) {
365 for (i = 0; i <
len; i++) {
371 for (i = l - 1; i >= 0; i--) {
390 for (i = l - 1; i >= 0; i--) {
402 for (i = l - 1; i > 0; i--) {
408 if (l == 1 && r[0] == 0) {
430 if (l == 1 && r[0] == 0) {
440 create(0, __FILE__, __LINE__);
446 if (!sgn && l == 1 && r[0] == 1) {
457 if (sgn && l == 1 && r[0] == 1) {
468 if (l == 1 && r[0] == 1) {
478 create(1, __FILE__, __LINE__);
486 b.
create(1, __FILE__, __LINE__);
496 b.
create(-1, __FILE__, __LINE__);
506 b.
create(a, __FILE__, __LINE__);
515 create(i, __FILE__, __LINE__);
533 b.
create(a, __FILE__, __LINE__);
basic number theoretic functions
int lint_log10(long int n)
domain to compute with objects of type longinteger
int compare(longinteger_object &a, longinteger_object &b)
void multiply_up(longinteger_object &a, int *x, int len, int verbose_level)
void print_digits(char *rep, int len)
void add(longinteger_object &a, longinteger_object &b, longinteger_object &c)
void mult(longinteger_object &a, longinteger_object &b, longinteger_object &c)
void power_int(longinteger_object &a, int n)
void add_in_place(longinteger_object &a, longinteger_object &b)
a class to represent arbitrary precision integers
int is_one_or_minus_one()
void create_from_base_b_representation(int b, int *rep, int len)
void create_from_base_10_string(const char *str, int verbose_level)
void print_to_string(char *str)
int compare_with_int(int a)
void assign_to(longinteger_object &b)
void create_product(int nb_factors, int *factors)
std::ostream & print(std::ostream &ost)
void print_width(std::ostream &ost, int width)
std::ostream & print_not_scientific(std::ostream &ost)
void create_i_power_j(int i, int j)
void create_power(int a, int e)
void create(long int i, const char *file, int line)
void swap_with(longinteger_object &b)
void create_power_minus_one(int a, int e)
#define NEW_char_with_tracking(n, file, line)
orbiter_kernel_system::orbiter_session * Orbiter
global Orbiter session
ostream & operator<<(ostream &ost, longinteger_object &p)
the orbiter library for the classification of combinatorial objects