Skip to content

Add New Number Validators #14

@chinmay29hub

Description

@chinmay29hub

Is your feature request related to a problem? Please describe.
I'm always frustrated when I need to perform common number validations such as checking if a number is prime, even, odd, a multiple of another number, a perfect square, or a perfect cube. These validations are not directly available as built-in Python functions.

Describe the solution you'd like
I would like to add the following new validators to the NumberValidator class:

  • isPrime: Check if a number is a prime number.
  • isEven: Check if a number is even.
  • isOdd: Check if a number is odd.
  • isMultipleOf: Check if a number is a multiple of another number.
  • isSquare: Check if a number is a perfect square.
  • isCube: Check if a number is a perfect cube.

These methods will provide useful validation functionality that is not directly available as default Python features.

Describe alternatives you've considered
I have considered using external libraries or writing these validations as standalone functions. However, integrating them into the NumberValidator class will provide a more cohesive and consistent approach within the library.

  • I am interested in working on this feature and would like to contribute to the project. Please assign this issue to me : ).

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