From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id F1168BC0B for ; Thu, 16 Nov 2006 19:02:21 +0100 (CET) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.224]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id kAGI2KlI011706 for ; Thu, 16 Nov 2006 19:02:21 +0100 Received: by wx-out-0506.google.com with SMTP id i31so617306wxd for ; Thu, 16 Nov 2006 10:02:20 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=KXr70oKkU+5H3MUrrfxImLSY78QvDyftgsIP9sQLTlNzexDG+raT+runJiE53tpgzezhtwbNVfzeLnWYAJNUxIsSwiywv0oEzBIqj8A8T/pdqdzKSP6t9NU6GLrolnKhiOcZh8o/ofAPK+/cs8WurUAo4NPrruTDv+UehrloPaA= Received: by 10.90.88.13 with SMTP id l13mr704268agb.1163700140655; Thu, 16 Nov 2006 10:02:20 -0800 (PST) Received: by 10.90.115.2 with HTTP; Thu, 16 Nov 2006 10:02:20 -0800 (PST) Message-ID: <875c7e070611161002p52e95c24qaa0d7872f82363b4@mail.gmail.com> Date: Thu, 16 Nov 2006 13:02:20 -0500 From: "Chris King" To: "OCaml Mailing List" Subject: Complex NaN / infinity? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-j-chkmail-Score: MSGID : 455CA7AD.000 on discorde : j-chkmail score : X : 0/20 1 X-Miltered: at discorde with ID 455CA7AD.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; bug:01 caml's:01 infinities:01 caml:02 div:97 module:03 module:03 avoiding:03 cartesian:04 expressions:04 expressions:04 complex:04 complex:04 i'd:05 representing:05 Hi, It's been reported before as a bug [1] that Caml's Complex module doesn't properly support complex NaN and infinities: the current behavior is that expressions such as "div one zero" return a complex number with real and imaginary parts both set to NaN. The proper behavior would be to return a value representing directed or complex infinity, depending on whether "zero" is directed or not. Avoiding infinite results doesn't help either, since expressions such as "pow zero one" rely on infinity internally. Has anyone made a replacement module fixing these problems? I've started work on a replacement which uses both polar and Cartesian representations internally but I figure I'd ask before duplicating work. - Chris King [1] http://caml.inria.fr/mantis/view.php?id=1817