mgriebling / bigdecimal Goto Github PK
View Code? Open in Web Editor NEWArbitrary-precision decimal arithmetic in Swift with full math functions and fixed-precision Decimal 32-, 64-, and 128-bit types.
License: MIT License
Arbitrary-precision decimal arithmetic in Swift with full math functions and fixed-precision Decimal 32-, 64-, and 128-bit types.
License: MIT License
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.
When I call log10 with some values, an assertion fails at BigDecimal/BigDecimal.swift:1118.
Example:
_ = BigDecimal.log10(BigDecimal(10.01))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.