Skip to content
This repository was archived by the owner on Sep 26, 2022. It is now read-only.

[FEATURE ADD] Simplify function calls #11

@HunterAP23

Description

@HunterAP23

Describe the feature that is being tested/implemented
Refactor function calls to use single function with a boundary=None argument.
if boundary is None, then set it to n
else it should be n/2 or math.floor(math.sqrt(n))

Pre-calculate that boundary value before calling the function to lower the performance cost of the n/2 or squre root of n boundary functions.

  • Rewrite is_prime_default(n: int, table: tuple) function to be is_prime(n: int, table: tuple, boundary=None)
  • Replace any calls to is_prime_half and is_prime_sqrt with calls to the new is+prime function
  • Rewrite inline versions of tests to also utilize this new boundary method

List any relations to other issues in this repository or in other repositories
N/A

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions