Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

O'Caml

Name: Anonymous 2011-07-31 14:16

Good day, fellow /prog/raiders.
I am currently learning O'Caml, what should I pay attention? What is Bad and what is Good on this language?

Name: Anonymous 2011-08-03 7:48

>>35
>>36

That is a lexic error. No, it's not lexyc.

Forgot my code tags.


let rec extended_gcd a b =
    if a > b then extended_gcd b a
    else
        if b = 0 then (1, 0)
        else
            let qr = divide a b;
            let st = extended_gcd b (snd qr);
            (snd st, (fun s q t -> s - q * t) (fst st) (fst qr) (snd st));;

Name: Anonymous 2011-08-03 7:53

>>38
Also, divide is
let divide x y = x / y, x mod y;;
and i took the algorithm directly from http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm#Recursive_method_2

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List