Comments (32)
Use Newton's method for sqrt()
.
from bigint.
Hi @arvindvs ,
I am working on GCD
from bigint.
Have you started any of those?
from bigint.
No, I haven't
from bigint.
Mind if I start with pow?
from bigint.
Whichever way you like. For pow
use the binary exponentiation method.
from bigint.
Hello! Came across this project from Up For Grabs
I have some doubt on the new pow
function. It's doing the a^n = (-a)^(1/n) if n < 0
transformation, but I think the formula should be a^n = 1/(a^(-n)) if n < 0
.
And the test didn't include any n < 0
cases yet...
from bigint.
Yeah, I'm fixing the pow
function and the tests. There are a few more issues with it such as handling 00, 0-1, 0-2 etc.
from bigint.
Mind if I try to get started on sqrt?
from bigint.
@arvindvs Sure, go ahead!
from bigint.
I'm currently having trouble compiling the code (sorry I'm completely new to open source and contributions ). I have edited the math.test.cpp file and math.hpp file and they are ready to commit to the branch I have created. Is it alright if I go ahead and push this commit without compiling and correcting potential errors, and you can take a look at it?
from bigint.
Yes, you can push your changes and create a PR. Then you can comment regarding the issue you're facing in your PR.
from bigint.
Hi,
I would like to contribute this project. Can I implement gcd part?
from bigint.
@anandsit043 Sure!
from bigint.
Can I get started on LCM? (I will have to implement GCD in order to make this work. If someone else is working on GCD, I can wait for them to finish. Otherwise I can proceed with both)
from bigint.
I would like to take up the is_probable_prime function if no is currently working on it.
from bigint.
@KingAkeem Go for it, as it doesn't seem like anyone else is working on it.
from bigint.
Awesome, I'm working on implementing Rabin-Miller primality testing now.
from bigint.
Should is_probable_prime be declared as a public member function but defined inside of math.hpp?
from bigint.
@KingAkeem Yes.
from bigint.
Hi @arvindvs,
Should I implement the lcm part or you are done with it?
from bigint.
@anandsit043 Sorry for the late response. Go ahead, I have not yet completed LCM.
from bigint.
how can i contribute to this project. I new to open source. Please guide.
from bigint.
@AanjaneyaSinghDhoni All of the functions mentioned in this issue have been implemented (PR for is_probable_prime
is under review).
If you'd like to contribute, you can try implementing the functions mentioned in issues #18 and #19. If you need some more info regarding implementation details, comment on the respective issues.
from bigint.
Hello, is_probable_prime
is not yet implemented right? Would it be okay if I gave it a shot?
from bigint.
Hello! Is this issue still open? I would like to contribute to it.
from bigint.
Hello @faheel sir, I am new to contributions and cmake, though I have a very good experience in coding with c++. I would like to take up the task of building a function out of the list mentioned above or if you can suggest any new function. Or if there's any other issue that might suit me, please suggest.
from bigint.
Hello! I'll give the "is_probable_prime" function a try! I'll send a message when it's finished.
from bigint.
Hello @faheel I have implemented and tested the is_probable_prime function, however it is difficult to test using a very large number due to the incredibly significant runtime caused when you take the (randomNumber) to the power of another amount.
On the wikipedia page (https://en.wikipedia.org/wiki/Miller–Rabin_primality_test) it would be where the pseudocode says x ← a^d mod n
Any tips?
from bigint.
Hello @faheel I have implemented and tested the is_probable_prime function, however it is difficult to test using a very large number due to the incredibly significant runtime caused when you take the (randomNumber) to the power of another amount.
On the wikipedia page (https://en.wikipedia.org/wiki/Miller–Rabin_primality_test) it would be where the pseudocode says x ← a^d mod n
Any tips?
You have to implement and use a modular exponentiation i.e. when computing X = A^B mod N, you do not compute A^B and then take the remainder modulo N, you loop on the binary representation of B squaring and/or multiplying by A mod N depending on whether the current bit is set.
Have a look at https://en.wikipedia.org/wiki/Modular_exponentiation and/or https://www.geeksforgeeks.org/modular-exponentiation-power-in-modular-arithmetic/.
from bigint.
Hi, checked this up at -up for grabs. Can someone help me with understanding what I should do? Does this issue ask for coding any program with math functions..
from bigint.
Hello sir I would like to add some math function.Please assignit to me
from bigint.
Related Issues (20)
- Build fails in CLion 2017.3 HOT 1
- Add support for hexadecimal string in constructor HOT 9
- Should is_valid_number be able to handle negative numbers? HOT 2
- big_random might return a BigInt having a value with a leading 0 HOT 4
- Hex support HOT 1
- `big_random` function: mistake in description and better implementation suggestion HOT 3
- Improve README
- sqrt() always returns 1 HOT 4
- Improve the documentation related to development
- Support bitwise operation HOT 12
- a bug in DIV HOT 1
- MacOS Invalid token in expression during Make HOT 1
- Cannot compile on msvc2019, cmake, when trying to compile the release 0.50 HOT 1
- Very slow compared to the GNU MP Bignum Library HOT 3
- BigInt problem with hexdigit string HOT 1
- `log()` support
- Elaborate instructions on which files to #include for which functions/operators HOT 2
- Fix for MSVC?
- Invalid string access on modulo
- Some BigInt relational operators are not optimal
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bigint.