Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- isSmallPrime :: Int -> Bool
- isSmallPrime 2 = True
- isSmallPrime 3 = True
- isSmallPrime 5 = True
- isSmallPrime 7 = True
- isSmallPrime _ = False
- equivalent :: Bool -> Bool -> Bool
- equivalent True True = True
- equivalent False False = True
- equivalent _ _ = False
- implies :: Bool -> Bool -> Bool
- implies True False = False
- implies _ _ = True
- invertO :: (Int, Int) -> (Int, Int)
- invertO (x,y) = (-x,-y)
- isOnNegId :: (Int, Int) -> Bool
- isOnNegId (x,y) = (-x==y)
- add :: (Int, Int) -> (Int, Int) -> (Int, Int)
- add (x,y) (a,b) = if y == b then (x+a,y)
- else (x*b+a*y,b*y)
- multiply :: (Int, Int) -> (Int, Int) -> (Int, Int)
- multiply (x,y) (a,b) = (x*a, y * b)
- divide :: (Int, Int) -> (Int, Int) -> (Int, Int)
- divide (x,y) (a,b) = (x*b,y*a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement