-
Notifications
You must be signed in to change notification settings - Fork 621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add math module for high precision computing #375
Conversation
@@ -0,0 +1,864 @@ | |||
/************************************** EDITABLE DEFAULTS *****************************************/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please list where you've forked this code from, the license, author, and copyright header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I add Deno copyright
header behind the origin copyright
header?
math/big/minus_test.ts
Outdated
* big.js v5.2.2 | ||
* A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic. | ||
* Copyright (c) 2018 Michael Mclaughlin <[email protected]> | ||
* https://github.com/MikeMcl/big.js/LICENCE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link is 404. Also please state the license "MIT License" in text.
I think this module might be better as an external one (deno.land/x) than in deno_std. The reason is that it's quite large and niche - which is going to slowly down my ability to review it. If you keep the same structure as deno_std, it can potentially be moved here later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, you only need to review the core module. It only has a few hundred lines of code
The test case is basically from big.js
It contains a large number of test cases to ensure the availability and stability of this package.
Would it make sense to import big.js directly from |
I have considered this issue too, but it has external dependencies, ie it seems not to meet the original intention of And we have to write declaration file for this. Of course, this is also a way to do. Depends on community opinion |
or we can wait for support In this case, we only need to introduce |
Links to external code isn't allowed in deno_std |
I'd rather have this as an external module for now. Please submit it to https://github.com/denoland/registry/blob/master/src/database.json |
move to https://github.com/axetroy/deno-math. or maybe add to |
refs: #347 https://golang.org/pkg/math/big/
porting https://github.com/MikeMcl/big.js
Extra features: support
BigInt
as input paramsThis is a draft for high precision computing solution.
If you think this is a viable option, I will continue to complete the rest.
What content including this PR?
Add
Big
module atMath/big/mod.ts
Add common high-precision calculation methods. Base on
Big
module inMath/mod.ts
.Plan in the future
add complex sub-module for