Projects

Longer Int

  • Library for arbitrary length integers
  • Written in C
  • Link to code
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 = 1701411834921604967429270619762735448065
2LINT* 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+b
6subtract_lint(a,b); // a=a-b
7mul_lint(a,b); // a=a*b
8div_lint(a,b); // a=a/b
9printf("%d\n", divisible(a, b));
10xor_lint(a,b); // a=a^b
11print_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
  • Implemented with C, SDL2, OpenCL
  • Link to code
This project allows the user to navigate the Mandelbrot set with the mouse buttons.
The code runs on the GPU by using the OpenCL api.

Web Based Mandelbrot Set Plotter

Very similar to the one above, but it's implemented in WebGL so it can run in a browser.
You can run it using this link.