Git Product home page Git Product logo

delphibignumbers's Introduction

BigNumbers

BigInteger, BigDecimal and BigRational for Delphi

These are implementations of the multi-precision BigInteger, BigDecimal and BigRational types, built from scratch.

BigInteger

BigInteger is a multi-precision integer. Its size is only limited by available memory.

BigInteger is built for ease of use, speed and reliability. It is written in plain Object Pascal and x86-32/x86-64 assembler, but every assembler function has a so called "pure Pascal" equivalent as well. It is modelled after the BigInteger type in .NET, but is far more optimized than that and provides an interface that is more in line with Delphi. It uses higher level algorithms like Burnikel-Ziegler, Karatsuba, Toom-Cook, etc. to make things fast even for very large integers. It offers overloaded operators and all the usual functions. More information can be found on the BigIntegers unit page on my website.

BigDecimal

BigDecimal is a multi-precision decimal floating point type. It can have an almost unlimited precision.

BigDecimal is equally built for ease of use and reliability. It builds on top of BigInteger: the internal representation is a BigInteger for the significant digits, and a scale to indicate the decimals. It also offers overloaded operators and all the usual functions. This is modelled after the BigDecimal type in Java, but the interface is more in line with Delphi. More information about this type can be found on the BigDecimals unit page on my website.

BigRational

A type that holds a number as fraction (ratio) of two BigIntegers, a numerator and a denominator, i.e. 1/7 or 100/3. This type is very good at simple arithmetic (+, -, *, /), since it doesn't lose precision or need any rounding. Still a work in progress...

C++Builder

The newest version of BigIntegers has additional overloaded operators and additional constructors that are compatible with C++Builder. So now you simply include:

#include "Velthuis.BigIntegers.hpp"

and then you can do things like:

BigInteger a = 17;
BigInteger b = "123";
BigInteger c = a + b;

Directory structure

BigNumbers
   DataGenerators
      BigDecimals
         BigDecimalTestDataGenerator /...       --- Test data generator in Java; 
	                                            open with NetBeans 8
      BigIntegers
         BigIntegerTestGenerator /...           --- Test data generator in C#; open .sln file with 
                                                    Visual Studio 2010 (Express) or newer
	 Java/BigIntegerTestDataGenerator /...  --- Newer test data generator in Java; 
	                                            open with NetBeans 8
      BigRationals                                   
         BigRationalTestDataGenerator /...      --- Test data generator in Java, using the Apache 
                                                    Commons-Math library.
                                                    Open with NetBeans 8. Might require installation 
                                                    of the Apache libs.
   Source                                       --- Sources for units and for bases.inc generator
   Tests
      BigDecimals /...                          --- Sources for DUnit tests for BigDecimals
      BigIntegers /...                          --- Sources for DUnit tests for BigIntegers
      BigRationals /...                         --- Sources for DUnit tests for BigRationals
   Visualizers                                  --- Sources for IDE debug visualizer DLL and packages for BigInteger 
                                                    and BigDecimal   

delphibignumbers's People

Contributors

rvelthuis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.