A library that implements integers that automatically grow in size instead of overflowing. The main idea behind the implementation is to represent a large integer as a polyonomial of powers of \(2^{32}\). One such number could be \(1701411834921604967429270619762735448065\), which is equal to \(5\cdot 2^{128} + 4\cdot 2^{96} + 3\cdot 2^{64} + 2\cdot 2^{32} + 1\cdot 2^{0} \). This will then be stored as the integer array [5, 4, 3, 2, 1] . The library implements all the operations 2 normal integers would support, namely addition, subtraction, multiplication, division, checking for divisibility, etc. Code example:
1// a = 17014118349216049674292706197627354480652LINT* a =new_lint_str("1701411834921604967429270619762735448065");3// b = 15*2^(32*44)4LINT* b =new_lint_num_degree(15,44);5add_lint(a,b);// a=a+b6subtract_lint(a,b);// a=a-b7mul_lint(a,b);// a=a*b8div_lint(a,b);// a=a/b9printf("%d\n",divisible(a, b));10xor_lint(a,b);// a=a^b11print_lint(a);
Note: Please don't use this in production applications, it's not optimised to that extent.
Mandelbrot Set Plotter
Program that allows zooming around the Mandelbrot set