diff options
| author | Matthias Wisniowski <matthias.wisniowski@gmail.com> | 2012-04-14 16:27:03 +0200 |
|---|---|---|
| committer | Matthias Wisniowski <matthias.wisniowski@gmail.com> | 2012-04-14 16:27:03 +0200 |
| commit | 9a0159cc0ff165f33527c9a4fe1a8ac0a2afc15b (patch) | |
| tree | bdff006965dfdd7f29dec0668e4e7538ab0c258c /AufgabeFFP2.hs | |
| parent | b773165e36a503064d39ae59a025aa33a0392339 (diff) | |
| download | ffp-9a0159cc0ff165f33527c9a4fe1a8ac0a2afc15b.tar.gz ffp-9a0159cc0ff165f33527c9a4fe1a8ac0a2afc15b.tar.bz2 ffp-9a0159cc0ff165f33527c9a4fe1a8ac0a2afc15b.zip | |
Testcases for 22
Diffstat (limited to 'AufgabeFFP2.hs')
| -rw-r--r-- | AufgabeFFP2.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/AufgabeFFP2.hs b/AufgabeFFP2.hs index 0415b32..7ed19fc 100644 --- a/AufgabeFFP2.hs +++ b/AufgabeFFP2.hs | |||
| @@ -69,11 +69,11 @@ f z k = g z k h | |||
| 69 | 69 | ||
| 70 | -- actual function g (converts Int to Integer for more precision) | 70 | -- actual function g (converts Int to Integer for more precision) |
| 71 | g :: Int -> Int -> (Integer -> Integer -> Float) -> Float | 71 | g :: Int -> Int -> (Integer -> Integer -> Float) -> Float |
| 72 | g z k h = sum $ map (h $ fromIntegral z) [1..(fromIntegral k)] | 72 | g z k h = sum $ map (h $ fromIntegral z) [0..(fromIntegral k)] |
| 73 | 73 | ||
| 74 | -- helper function h using mem-table for the power-series (z^i) and for factorial (i!) | 74 | -- helper function h using mem-table for the power-series (z^i) and for factorial (i!) |
| 75 | hMT :: Integer -> Integer -> Float | 75 | hMT :: Integer -> Integer -> Float |
| 76 | hMT z i = (fromInteger $ pofNs z !! (fromInteger i)) / (fromInteger $ facs !! (fromInteger i-1)) | 76 | hMT z i = (fromInteger $ pofNs z !! (fromInteger i)) / (fromInteger $ facs !! (fromInteger i)) |
| 77 | 77 | ||
| 78 | -- helper function h without memoization | 78 | -- helper function h without memoization |
| 79 | h :: Integer -> Integer -> Float | 79 | h :: Integer -> Integer -> Float |
| @@ -98,4 +98,4 @@ gz n | |||
| 98 | 98 | ||
| 99 | -- goedel-number generator | 99 | -- goedel-number generator |
| 100 | gzs :: [Integer] | 100 | gzs :: [Integer] |
| 101 | gzs = map gz [1..] | 101 | gzs = map gz [0..] |
