Skip to content

maximfersko/Convertor_Decimal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

lib_decimal

A C library implementing conversions between int/float and a custom 96-bit decimal type, with support for special values (INFINITY, -INFINITY, NAN).

Tech Stack

C (C99), gcc, ar

API

Function Signature
int → decimal int from_int_to_decimal(int src, decimal *dst)
float → decimal int from_float_to_decimal(float src, decimal *dst)
decimal → int int from_decimal_to_int(decimal src, int *dst)
decimal → float int from_decimal_to_float(decimal src, float *dst)

Return codes: 0 — success, 1 — error.

Quick Start

cd src

# Build static library → libs/convertorslib.a
make

# Clean build artifacts
make clean

Link against the resulting static library:

gcc main.c -L./src/libs -lconvertorslib -lm -o decimal

About

Implementation convertor for working with the Decimal data type

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors