2017-07-31 13:03:18 -04:00
2017-07-29 16:33:47 -04:00
2017-07-30 18:41:16 -04:00
2017-07-31 13:03:18 -04:00
2017-07-30 18:41:16 -04:00

silly

A toy library implementing fixed-point arithmetic. Please don't use it, the name is descriptive.

Installation

Don't. The makefile only includes a test target, because I want to test my code.

Usage

silly silly_zeros(); // creates a fixed point value of zero
silly make_silly(short, int, int); // make a silly number from the triple (negative?, before decimal, after)

double silly_to_double(silly); // convert a silly number into a double

silly silly_add(silly, silly); // addition
silly silly_sub(silly, silly); // subtraction
silly silly_mul(silly, silly); // multiplication

char* silly_to_string(silly); // converts a fixed point value to a string (memory is now yours)

That's it!


Have fun!

Description
A silly implementation of fixed point arithmetic
Readme 308 KiB
Languages
C 99.8%
Makefile 0.2%