GithubHelp home page GithubHelp logo

mgriebling / bigdecimal Goto Github PK

View Code? Open in Web Editor NEW
20.0 20.0 6.0 1.96 MB

Arbitrary-precision decimal arithmetic in Swift with full math functions and fixed-precision Decimal 32-, 64-, and 128-bit types.

License: MIT License

Swift 99.24% HTML 0.47% JavaScript 0.29%
arbitrary-precision bigdecimal decimal-functions decimal-numbers decimal128 decimal32 decimal64 math

bigdecimal's People

Contributors

collingray avatar jcsoohwancho avatar leif-ibsen avatar manhphi65 avatar mgriebling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bigdecimal's Issues

Confused on Division Implementation

Hello!

More of an implementation question than anything else, buy why does the '/' operation truncate by default?

And if possible, can there instead be two '/' functions? One that keeps the original functionality but returns it as the relevant int type instead, and another that just returns the '.divide' function as a decimal. Or perhaps replace the current function with '÷' and use '/' for '.divide'?

This would just make it much easier to use the package as a drop in replacement for a double. If you agree with the change, I can even create the pull request.

`log10` causes assertion to fail

When I call log10 with some values, an assertion fails at BigDecimal/BigDecimal.swift:1118.

Example:

_ = BigDecimal.log10(BigDecimal(10.01))

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.