Images, snippets, snapshots, math

View Gabriele Lami's profile on LinkedIn

martedì 18 agosto 2009

Numbers in Haskell

The core of numbers post in Haskell:


idens p q x = case ( rem ( x ^ 2 ) p ) of { 1 -> 1 ; _ -> 0 }
numList p x = map ( idens p x ) ( map ( x * ) [ 1..( p-1 ) ] )
matIde p = map ( numList p ) [ 1..(p-1) ]

Nessun commento: