From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA05092 for caml-redistribution; Mon, 14 Sep 1998 09:42:07 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA25764 for ; Sat, 12 Sep 1998 14:22:21 +0200 (MET DST) Received: from miss.wu-wien.ac.at (miss.wu-wien.ac.at [137.208.107.17]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id OAA06895 for ; Sat, 12 Sep 1998 14:22:20 +0200 (MET DST) Received: (from mottl@localhost) by miss.wu-wien.ac.at (8.9.0/8.9.0) id OAA29992 for caml-list@inria.fr; Sat, 12 Sep 1998 14:22:13 +0200 (MET DST) From: Markus Mottl Message-Id: <199809121222.OAA29992@miss.wu-wien.ac.at> Subject: Bug converting numbers? To: caml-list@inria.fr (OCAML) Date: Sat, 12 Sep 1998 14:22:12 +0100 (MET DST) X-Mailer: ELM [version 2.4 PL21] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: weis Hello - Bonjour! I have encountered unexpected behaviour converting integers to floats: # let x = 7.;; val x : float = 7 # let y = float 7;; val y : float = 7 # x == y;; - : bool = false The internal representation of "7." is obviously different to "float 7". Is there some reason to it? This makes it hard to write things like: if a_float == float (truncate a_float) ... if one wants to check whether a float can actually be represented as an integer... français: La représentation de "7." et évidemment differente de "float 7". Est-ce qu'il y a une raison? C'est un problème si on veut verifier si un "float" peut être représenté comme "int"... Regards, Markus Mottl -- * Markus Mottl | University of Economics and * * Department of Applied | Business Administration * * Computer Science | Vienna, Austria * * mottl@miss.wu-wien.ac.at | http://miss.wu-wien.ac.at/~mottl *