Skip to content

Conversation

jedisct1
Copy link
Contributor

This adds an iterative EGCD implementation to std.math.

The implementation is simple and conservative, returns Bézout coefficients consistent with widely‐used implementations, and has been formally verified for any value and type supported by Zig up to u65534/i65534.

Its purpose is to make this API available to projects and other parts of the standard library. Optimizations for specific types or value ranges (e.g., using a binary method with or without approximations) can be added later without any changes to existing applications.

This adds an iterative EGCD implementation to std.math.

The implementation is simple and conservative, returns Bézout
coefficients consistent with widely‐used implementations, and has
been formally verified correct for any value and type supported
by Zig up to u65534/i65534.

Its purpose is to make this API available to projects and other
parts of the standard library. Optimizations for specific types or
value ranges (e.g., using a binary method or approximations) can be
added later without any changes to existing applications.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant