September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,14 +0,0 @@
|
|||
import Data.Complex
|
||||
|
||||
main = do
|
||||
let a = 1.0 :+ 2.0 -- complex number 1+2i
|
||||
let b = 4 -- complex number 4+0i
|
||||
-- 'b' is inferred to be complex because it's used in
|
||||
-- arithmetic with 'a' below.
|
||||
putStrLn $ "Add: " ++ show (a + b)
|
||||
putStrLn $ "Subtract: " ++ show (a - b)
|
||||
putStrLn $ "Multiply: " ++ show (a * b)
|
||||
putStrLn $ "Divide: " ++ show (a / b)
|
||||
putStrLn $ "Negate: " ++ show (-a)
|
||||
putStrLn $ "Inverse: " ++ show (recip a)
|
||||
putStrLn $ "Conjugate:" ++ show (conjugate a)
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
*Main> main
|
||||
Add: 5.0 :+ 2.0
|
||||
Subtract: (-3.0) :+ 2.0
|
||||
Multiply: 4.0 :+ 8.0
|
||||
Divide: 0.25 :+ 0.5
|
||||
Negate: (-1.0) :+ (-2.0)
|
||||
Inverse: 0.2 :+ (-0.4)
|
||||
Conjugate:1.0 :+ (-2.0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue