From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA04246; Fri, 27 Feb 2004 16:36:34 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA03591 for ; Fri, 27 Feb 2004 16:36:32 +0100 (MET) Received: from ms-smtp-02-eri0.ohiordc.rr.com (ms-smtp-02-smtplb.ohiordc.rr.com [65.24.5.136]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i1RFaSae032418 for ; Fri, 27 Feb 2004 16:36:31 +0100 Received: from vilya (cpe-024-033-200-041.columbus.rr.com [24.33.200.41]) by ms-smtp-02-eri0.ohiordc.rr.com (8.12.10/8.12.7) with ESMTP id i1RFaMtO022325; Fri, 27 Feb 2004 10:36:23 -0500 (EST) Received: from peuter ([192.168.2.2] ident=mail) by vilya with esmtp (Exim 3.36 #1 (Debian)) id 1Awk2I-0003Te-00; Fri, 27 Feb 2004 10:36:22 -0500 Received: from andrewl by peuter with local (Exim 3.36 #1 (Debian)) id 1Awk2H-0000P6-00; Fri, 27 Feb 2004 10:36:21 -0500 Date: Fri, 27 Feb 2004 10:36:21 -0500 From: Andrew Lenharth To: Alexander Danilov Cc: caml-list@inria.fr Subject: Re: [Caml-list] complex numbers Message-ID: <20040227153621.GA1533@peuter> References: <403EDDD1.6080801@fssg.st-oskol.ru> <20040227131719.GA827@peuter> <403F5ABD.1090402@fssg.st-oskol.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <403F5ABD.1090402@fssg.st-oskol.ru> User-Agent: Mutt/1.5.5.1+cvs20040105i X-Virus-Scanned: Symantec AntiVirus Scan Engine X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 val:01 2004:99 2004:99 ocaml:01 alexander:01 alexander:01 mul:01 exists:01 float:02 0300,:02 0300,:02 module:03 complex:03 complex:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Not that I know of, though you can define them yourself. # let (+..) x y = add x y;; val ( +.. ) : Complex.t -> Complex.t -> Complex.t = # {re = 1.0; im = 1.0} +.. {re = 1.0; im = 1.0};; - : Complex.t = {re = 2.; im = 2.} Andrew Lenharth On Fri, Feb 27, 2004 at 05:57:01PM +0300, Alexander Danilov wrote: > Andrew Lenharth wrote: > > >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. > >> > >> > >> > > > Thank you. > But what about infix operations for Complex numbers, I mean something > like +.,-., /., ... exists for float > numbers, any such operations defined for complex number? > -- "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