Skip to content
/ IADF Public

The fixed-capacity decimal arithmetic for the numbers with the decimal point natural placement (this representation used for financial hardware calculators).

License

Notifications You must be signed in to change notification settings

R0bur/IADF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IADF

The fixed-capacity decimal arithmetic for the numbers with the decimal point natural placement (this representation used for financial hardware calculators).

The Author: Ihar Areshchankau, 2019.

Usage:

  1. Specify the needed capacity of the arithmetic into the file "iadf.h":
...
#define IADFCAPACITY 10
...
  1. Include the header "iadf.h" into the program and use the abilities it provides:
  #include "iadf.h"
  #define N (IADFCAPACITY + 4)
  ...
  char a[] = "1234.56789";
  char b[] = "-98765.4321";
  char c[N];
  struct IADF dfa, dfb;
  ...
  iadfInit (&dfa, a);
  iadfInit (&dfb, b);
  iadfAdd (&dfa, &dfb);
  iadfToStr (&dfa, c, N);
  printf ("Addition: (%s) + (%s) = (%s)\n", a, b, c);
  1. Please look the file "demo.c" for the more descriptive example.

About

The fixed-capacity decimal arithmetic for the numbers with the decimal point natural placement (this representation used for financial hardware calculators).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published