Compute factorial of arbitrarily large numbers by storing individual digits in a byte.
More...
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
Compute factorial of arbitrarily large numbers by storing individual digits in a byte.
- Author
- Krishna Vedala
◆ add_digit()
void add_digit |
( |
large_num * |
num, |
|
|
unsigned int |
value |
|
) |
| |
add a digit to the large number
- Parameters
-
[in,out] | num | |
[in] | value | value of the digit to insert |
52 fprintf(stderr,
"digit > 9!!\n");
◆ delete_number()
delete all memory allocated for large number
- Parameters
-
[in] | num | pointer to large_num to delete |
◆ new_number()
create a new large number
- Returns
- pointer to a large number
28 new_num->
digits = (
char *)malloc(1 *
sizeof(
char));