Skip to content
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

Completely freezing compilation when trying to find all prime factors of 0️⃣ ⚠️ ⚠️ ⚠️ #8

Open
2 tasks done
artbindu opened this issue Feb 8, 2023 · 1 comment

Comments

@artbindu
Copy link

artbindu commented Feb 8, 2023

I know to find the prime factors we have to pass a positive number.

Also, 0 does not have a prime factorization, because it is not a positive integer. Prime factorization is the process of finding the prime numbers that multiply together to form a given integer. Since 0 is not a positive integer, it does not have a prime factorization.


This is the definition according to your documentation:

  • primes.factor(n) returns the lowest prime factor of n.
  • primes.facors(n) returns all the prime factors of n with multiplicity.

When I am passing a negative number it's throwing error as expected.
When I pass 0 two issue is happening.

  1. primes.factor(0) send me output 2. I don't how it's happening.
  2. when run primes.factors(n), it's completely freezing my system. Not showing any output or error.

This is my code:
Screenshot 2023-02-08 at 2 03 40 PM


Please resolve this issue.

@artbindu artbindu changed the title Completely freezing compilation when trying to find all prime factors of 0️⃣ Completely freezing compilation when trying to find all prime factors of 0️⃣ ⚠️ ⚠️ ⚠️ Feb 8, 2023
@artbindu
Copy link
Author

artbindu commented Jan 9, 2024

Issue is fixed in this branch
https://github.com/artbindu/primePybugFixed

Commit:
artbindu@fe9aa90

Please verify once @janaindrajit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant