Skip to content

Primality test not touching the built-in arithmetic operators for primitive types in Rust.

Notifications You must be signed in to change notification settings

olivereanderson/iterator_modulo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

This is my solution to the following challenge: Check if a usize is a prime number in Rust without touching the built-in arithmetic operations (+, -, *, /, %) for the numeric primitive types. We are allowed to call functionality from the standard library that may use some of these arithmetic operations under the hood.

We emphasise that the code we present here is only a solution to an exercise and not suitable for real world problems. The prime checker we produce is indeed extremely slow! The only real value of this repository is for the novice Rust developer to get some practice with the yoga of iterators, const generics and modules.

About

Primality test not touching the built-in arithmetic operators for primitive types in Rust.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages