Giter Site home page Giter Site logo

mgriebling / bigdecimal Goto Github PK

View Code? Open in Web Editor NEW
19.0 0.0 5.0 1.91 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.48% JavaScript 0.29%
arbitrary-precision decimal-numbers decimal128 decimal32 decimal64 math decimal-functions bigdecimal

bigdecimal's Issues

`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))

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.

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.