pierwill / gaussiant Goto Github PK
View Code? Open in Web Editor NEWGaussian integers in Rust.
Home Page: https://crates.io/crates/gaussiant
Gaussian integers in Rust.
Home Page: https://crates.io/crates/gaussiant
If possible, use primal::is_prime
instead of this.
The lists of methods and trait implementations for num_complex::Complex
is a good source of inspiration for this crate.
Use list of G. primes with |a|,|b|<=5 from here.
I'd like to be able to do something like this:
test_is_gaussian_prime!(
-5-4i
-5-2i
-5+2i
-5+4i
-4-5i
-4-i
-4+i
-4+5i
-3-2i
-3
-3+2i
-2-5i
-2-3i
-2-i
-2+i
-2+3i
-2+5i
-1-4i
-1-2i
-1-i
-1+i
-1+2i
-1+4i
-3i
3i
1-4i
1-2i
1-i
1+i
1+2i
1+4i
2-5i
2-3i
2-i
2+i
2+3i
2+5i
3-2i
3
3+2i
4-5i
4-i
4+i
4+5i
5-4i
5-2i
5+2i
5+4i
)
I'd love to be able to do
let z = gauss!(1, 1); // 1 + i
or even
let z = gauss!("1+i");
instead of GaussianInt::new()
every time.
(I'm assuming gauss!(1+i)
will never work.)
I'm not fully confident in the code for this algorithm yet. The integer types don't feel right. And I'm not at all sure the places where it uses absolute values are correct.
num_complex
does this.
The norm is always real.
If the user wants a GaussianInt
, they can always do gaussint!(z.norm())
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.