Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] complex numbers
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Andrew Lenharth <alenhart@c...>
Subject: Re: [Caml-list] complex numbers
open Complex;;

let x = {re = 1.0; im = 1.0};;

let y = mul x {re = -1.0; im = -1.0};;

let z = norm2 y;;

let a = norm x;;

The rest of the functions are in the standard library Complex module
documentation.  This should be enough to get you started.

Andrew Lenharth

On Fri, Feb 27, 2004 at 09:04:01AM +0300, Alexander Danilov wrote:
> Please, show me an example how to work with complex numbers in Ocaml.
> I mean, how to create complex number, how to perform orepations (+ - * 
> /) with complex numbers.
> Thanx.
> 
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr Archives: 
> http://caml.inria.fr
> Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: 
> http://caml.inria.fr/FAQ/
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

-- 
"It will work in practice, yes. But will it work in theory?"
--- a french diplomat's comment, recalled by Madeleine  Albright

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners