Skip to main content

A few ad hoc numeric alogrithms: `factors` and `primes`.

Project description

A few ad hoc numeric alogrithms: factors and primes.

Latest release 20220606: New intif(f): int(f) if that equals f, otherwise f.

Function factors(n)

Generator yielding the prime factors of n in order from lowest to highest.

Function intif(f: float)

Return int(f) if that equals f, otherwise f.

Function primes()

Generator yielding the primes in order starting at 2.

Release Log

Release 20220606: New intif(f): int(f) if that equals f, otherwise f.

Release 20190309: Superficial changes.

Release 20150311.2: Added RST doco for cs.numeric.

Release 20150311: Initial release with primes() and factors().

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cs.numeric-20220606.tar.gz (2.4 kB view hashes)

Uploaded Source

Built Distribution

cs.numeric-20220606-py3-none-any.whl (2.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page