Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec NWD = function
- | (0,n) -> n
- | (m,n) -> NWD (n%m, m)
- let skroc (l,m) =
- let znak = if l+m<0 then -1 else 1
- let al = abs l
- let am = abs m
- let d = NWD(al,am) in (znak * (al/d),am/d)
- [<EntryPoint>]
- let main argv =
- printfn "a teraz skracamy ulamek 32/64"
- printfn "%A" (skroc(32,64))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement