arithmoi-0.10.0.0: Efficient basic number-theoretic functions.

Copyright (c) 2016 Chris Fredrickson Google Inc. MIT Chris Fredrickson None Haskell2010

Description

This module exports functions for manipulating Gaussian integers, including computing their prime factorisations.

Synopsis

# Documentation

A Gaussian integer is a+bi, where a and b are both integers.

Constructors

 (:+) infix 6 Fieldsreal :: !Integer imag :: !Integer
Instances
 Source # Instance details Methods Source # Instance details Methods Source # Instance details Methods Source # Instance details MethodsshowList :: [GaussianInteger] -> ShowS # Source # Instance details Associated Typestype Rep GaussianInteger :: Type -> Type # Methods Source # Instance details Methodsrnf :: GaussianInteger -> () # Source # Instance details Methods Source # Instance details Methods Source # Instance details Methods Source # Instance details Methods Source # Instance details Methods Source # Instance details type Rep GaussianInteger = D1 (MetaData "GaussianInteger" "Math.NumberTheory.Quadratic.GaussianIntegers" "arithmoi-0.10.0.0-ERYv2VuF0BeGX7OVoZ5V00" False) (C1 (MetaCons ":+" PrefixI True) (S1 (MetaSel (Just "real") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Integer) :*: S1 (MetaSel (Just "imag") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Integer)))

The imaginary unit, where

ι .^ 2 == -1

Conjugate a Gaussian integer.

The square of the magnitude of a Gaussian integer.

An infinite list of the Gaussian primes. Uses primes in Z to exhaustively generate all Gaussian primes (up to associates), in order of ascending magnitude.

Find a Gaussian integer whose norm is the given prime number of form 4k + 1 using Hermite-Serret algorithm.