Skip to content

Fixed-Point Decimal Library from Carnegie Mellon University

License

Notifications You must be signed in to change notification settings

prashanthduvvada/libfixeypointy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libfixeypointy

We couldn't use the name "libfixedpoint" because it would be terrible for SEO...


CircleCI

This is a portable C++ library for fixed-point decimals. It was originally developed as part of the NoisePage database project at Carnegie Mellon University.

This library implements decimals as 128-bit integers and stores them in scaled format. For example, it will store the decimal 12.23 with scale 5 1223000. Addition and subtraction operations require two decimals of the same scale. Decimal multiplication accepts an argument of lower scale and returns a decimal in the higher scale. Decimal division accepts an argument of the denominator scale and returns the decimal in numerator scale. A rescale decimal function is also provided.

The following files are included:

  • decimal.cpp - The core fixed decimal package supporting decimals with fixed precision(38) and a max scale of 38.
  • decimal_multiplication_generator.py - Generates tests for the multiplication operations.
  • magic_number_generator.py - To optimize multiplication and division with specific constants we can generate precompiled constats to speed it up.

About

Fixed-Point Decimal Library from Carnegie Mellon University

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 77.3%
  • Python 13.5%
  • CMake 9.2%