PrimeNumber class

A utility class for performing prime number related operations. This class provides methods to generate a sequence of prime numbers and to confirm if a single number is prime.

Constructors

PrimeNumber()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

generatePrimes(int limit) List<int>
Generates a list of prime numbers up to a specified limit using the Sieve of Eratosthenes algorithm.
isPrime(int n) bool
Confirms whether a given integer is a prime number.