# Programming with Finite Fields

DevFeed: [Programming with Finite Fields](<https://devfeed.tech/articles/programming-with-finite-fields-40350.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2014/03/13/programming-with-finite-fields/>)

Published: 2014-03-13T10:00:11Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Programming](<https://devfeed.tech/topics/programming.md>), [math](<https://devfeed.tech/topics/math.md>), [Python](<https://devfeed.tech/topics/python.md>), [Code](<https://devfeed.tech/topics/code.md>), [Programming language](<https://devfeed.tech/topics/programming-language.md>)

Tags: [algorithms](<https://devfeed.tech/tags/algorithms.md>), [classes](<https://devfeed.tech/tags/classes.md>), [code](<https://devfeed.tech/tags/code.md>), [decorators](<https://devfeed.tech/tags/decorators.md>), [division-algorithm](<https://devfeed.tech/tags/division-algorithm.md>), [elliptic-curves](<https://devfeed.tech/tags/elliptic-curves.md>), [euclidean-algorithm](<https://devfeed.tech/tags/euclidean-algorithm.md>), [euclidean-domain](<https://devfeed.tech/tags/euclidean-domain.md>), [factoring](<https://devfeed.tech/tags/factoring.md>), [field-characteristic](<https://devfeed.tech/tags/field-characteristic.md>), [finite-fields](<https://devfeed.tech/tags/finite-fields.md>), [gcd](<https://devfeed.tech/tags/gcd.md>), [math](<https://devfeed.tech/tags/math.md>), [operator-overloading](<https://devfeed.tech/tags/operator-overloading.md>), [polynomial-ring](<https://devfeed.tech/tags/polynomial-ring.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-language](<https://devfeed.tech/tags/programming-language.md>), [python](<https://devfeed.tech/tags/python.md>), [randomized-algorithm](<https://devfeed.tech/tags/randomized-algorithm.md>), [typecasting](<https://devfeed.tech/tags/typecasting.md>)

## AI overview

This tutorial explains how to implement number types in Python for arithmetic over finite fields. It introduces integers modulo a prime as a finite field and lays groundwork for later elliptic-curve arithmetic.

## Source excerpt

Back when I was first exposed to programming language design, I decided it would be really cool if there were a language that let you define your own number types and then do all your programming within those number types. And since I get excited about math, I think of really exotic number types (Boolean rings, Gaussian integers, Octonions, oh my!). I imagined it would be a language feature, so I could do something like this: