Advertisement
Ceron

Haskell Übungsblatt 2

Oct 21st, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Aufgabe 2.4
  2.  
  3. >module Uebung2
  4. >   where
  5. >       --min3 :: Int -> Int -> Int -> Int
  6. >       min3 x y z
  7. >           | (x < y) && (x < z) = x
  8. >           | (y < x) && (y < z) = y
  9. >           | (z < x) && (z < y) = z
  10. >           | otherwise = error "Fehler!"
  11.  
  12. Aufgabe 2.5
  13.  
  14. Die Signatur muss angepasst werden.
  15. Bsp. min3 :: Double -> Double -> Double -> Double
  16.  
  17. >       allequal :: Bool -> Bool -> Bool -> Bool
  18. >       allequal a b c
  19. >           |(a == b) && (b == c) = True
  20. >           |otherwise = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement