Table of Contents
This project is the implementation of uint1024_t, which is a custom data type for arbitrary-precision arithmetic. The current implementation stores uint1024_t as an array of uint8_t. It puts two decimal digits in each array cell.
The following functions are accessible:
- uint1024_t from_uint(unsigned int x) - generate uint1024_t from unsigned int
- uint1024_t add_op(uint1024_t *x, uint1024_t *y) - add two numbers x and y
- uint1024_t subtr_op(uint1024_t *x, uint1024_t *y) - subtruct y from x
- uint1024_t mult_op(uint1024_t *x, uint1024_t *y) - multiply x and y (implemented as the most straightforward algorithms used for multiplying numbers by hand (as taught in primary school))
- void printf_value(uint1024_t *x) - output value of x to standard output
- void scanf_value(uint1024_t *x) - read value of x from standard input
To use this uint1024_t implementation, follow the simple steps below.
- Clone the repo
git clone https://github.com/MariaMozgunova/uint1024_t.git
- Include uint1024_t implementation into your code
#include "uint1024_t/utils.c"
See uint1024_t.c
for examples of usage.
Distributed under the MIT License. See LICENSE
for more information.
Maria Mozgunova - Twitter - @MariaMozgunova - mariiamozgunova@gmail.com
Project Link: https://github.com/MariaMozgunova/uint1024_t