Giter Site home page Giter Site logo

godecimal's Introduction

GoDecimal

A decimal number representation in Go where numbers are stored using scientific notation.

Useful to do operations involving decimals that require high precision and accuracy such as those involving money.

Testing

This library goal is to have 100% code coverage and to Fuzz all the major functions.

Please open issues on this repository if anything was missed.

To run a comprehensive system test run make full-test.

Limitations

A Decimal is represented by an uint64 representing it's absolute value, a int64 value representing a power of 10 to multiply the number to, and finally a bool representing the sign.

Type Value
Largest Decimal math.MaxUint64*10^math.MaxInt64
Smallest Decimal -math.MaxUint64*10^math.MaxInt64
Smallest Positive Decimal 1*10^math.MinInt64
Largest Negative Decimal -1*10^math.MinInt64

Precision

18446744073709551615 (math.MaxUint64) is the largest number we can represent in our decimal with precision.

Due to the way in which we do certain operations we have between 18 and 20 significant figures represented.

godecimal's People

Contributors

stefanovazzocell 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.