Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
24
Task/Vector/F-Sharp/vector.fs
Normal file
24
Task/Vector/F-Sharp/vector.fs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
open System
|
||||
|
||||
let add (ax, ay) (bx, by) =
|
||||
(ax+bx, ay+by)
|
||||
|
||||
let sub (ax, ay) (bx, by) =
|
||||
(ax-bx, ay-by)
|
||||
|
||||
let mul (ax, ay) c =
|
||||
(ax*c, ay*c)
|
||||
|
||||
let div (ax, ay) c =
|
||||
(ax/c, ay/c)
|
||||
|
||||
[<EntryPoint>]
|
||||
let main _ =
|
||||
let a = (5.0, 7.0)
|
||||
let b = (2.0, 3.0)
|
||||
|
||||
printfn "%A" (add a b)
|
||||
printfn "%A" (sub a b)
|
||||
printfn "%A" (mul a 11.0)
|
||||
printfn "%A" (div a 2.0)
|
||||
0 // return an integer exit code
|
||||
Loading…
Add table
Add a link
Reference in a new issue