cleaned some warning by adding type signatures

This commit is contained in:
Yann Esposito 2012-06-15 11:56:48 +02:00
parent f57e6336f3
commit c9c91cda80
3 changed files with 4 additions and 3 deletions

View file

@ -3,11 +3,12 @@ module Mandel (mandel) where
import ExtComplex
mandel :: Float -> Float -> Float -> Int -> Int
mandel r i s nbIterations =
f (extcomplex r i s) 0 nbIterations
where
f :: ExtComplex -> ExtComplex -> Int -> Int
f c z 0 = 0
f _ _ 0 = 0
f c z n = if (magnitude z > 2 )
then n
else f c ((z*z)+c) (n-1)

View file

@ -230,7 +230,7 @@ The rest is similar to the preceding sections.
> -- where ε=(max-min)/2^(nbtest+1)
> maxZeroIndex :: (Fractional a,Num a,Num b,Eq b) =>
> (a -> b) -> a -> a -> Int -> a
> maxZeroIndex func minval maxval 0 = (minval+maxval)/2
> maxZeroIndex _ minval maxval 0 = (minval+maxval)/2
> maxZeroIndex func minval maxval n =
> if (func medpoint) /= 0
> then maxZeroIndex func minval medpoint (n-1)

View file

@ -3,7 +3,7 @@ module Mandel (mandel) where
import ExtComplex
mandel :: GLfloat -> GLfloat -> GLfloat -> Int -> Int
mandel :: Float -> Float -> Float -> Int -> Int
mandel r i s nbIterations =
f (extcomplex r i s) 0 nbIterations
where