Version française
Home     About     Download     Resources     Contact us    
Browse thread
Float literals
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Erik de Castro Lopo <mle+ocaml@m...>
Subject: Re: [Caml-list] Float literals
Edgar Friendly wrote:

> But it doesn't match some expectations I have about float literals.  The
> following are all float literals:
> 
> 3.14      (* no problem here *)
> 6.022E23  (* no problem here *)
> 9.109e-31 (* still no problem *)
> 2.        (* a float - blank decimal part *)
> 1e6       (* an integer?  no, a float without a .  Problem.*)
> 13        (* valid as a float, according to the above definition *)
> 
> Does anyone else find the last two cases kind of odd?

I do not find the second last case odd (all languages I have used
consider that a float), but I do for the last one.

Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"Neither noise nor information is predictable."
  -- Ray Kurzweil