From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q18Cso59026365 for ; Wed, 8 Feb 2012 13:54:52 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmMCAK9vMk9KfVK2kGdsb2JhbABDhQ2ZfohMAYgKCCIBAQEBCQkNBxQEI4FyAQEBAwESAg8dARsSCwEDAQsGAwIEBxodAgIhAQERAQUBChIGExIQh1oJm3EKiyZLgnCFEj+IcwIFC4gRgyAfGwYBAQErDAKDSggORwuCQ4EWBIJbklKLDIMSPYQD X-IronPort-AV: E=Sophos;i="4.73,383,1325458800"; d="scan'208";a="130574015" Received: from mail-we0-f182.google.com ([74.125.82.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 08 Feb 2012 13:54:51 +0100 Received: by werm13 with SMTP id m13so618391wer.27 for ; Wed, 08 Feb 2012 04:54:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=DyVGXn5Nu+h+6eGtZtfz/uqZm+P5s/qDhYFmWDJNi/0=; b=vQQFwyaEuyJPQIPbOOxKb+ndeTGpAUeCpXif/CldnXg627uOq+R2atkmdQ1T1iPZNn YRbxOqOybJ2TuKrolLF9SQCmILEASndMHKX7dWIMO4+eom+oYcfJ9I+Xvpw+jhxwQBg/ 8C4jvhNXUxFthCpCbibxD8sn4xMsJMo2qlNfg= Received: by 10.216.131.39 with SMTP id l39mr6738927wei.4.1328705691231; Wed, 08 Feb 2012 04:54:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.42.208 with HTTP; Wed, 8 Feb 2012 04:54:10 -0800 (PST) In-Reply-To: <4F326EA6.20900@gmail.com> References: <4F326EA6.20900@gmail.com> From: Gabriel Scherer Date: Wed, 8 Feb 2012 13:54:10 +0100 Message-ID: To: =?UTF-8?B?TWF0ZWogS2/FocOtaw==?= <5764c029b688c1c0d24a2e97cd764f@gmail.com> Cc: caml-list@inria.fr Content-Type: multipart/alternative; boundary=0016e6d99a6dbca48704b87366ed Subject: Re: [Caml-list] syntactic detail --0016e6d99a6dbca48704b87366ed Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable There is no purpose, it's just an edge case of the simple lexical specification you can find at: http://caml.inria.fr/pub/docs/manual-ocaml/lex.html#float-literal Everywhere digits are allowed, you can insert extraneous underscores. There is no restriction that there must be at least one digit for underscores to be valid. I don't see why there should be. On Wed, Feb 8, 2012 at 1:46 PM, Matej Ko=C5=A1=C3=ADk < 5764c029b688c1c0d24a2e97cd764f@gmail.com> wrote: > Hi, > > Ocaml allows me to add '_' at the end of a floating point literal, e.g.: > > 1._ > > What can be a purpose for that? > > In case of long or Long integers, optional adding of '_' between the > integer and 'l' or 'L' make sense ('l' is hard to discriminate from '1' > for many fonts). But in case of floats, I am not sure. > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > > --0016e6d99a6dbca48704b87366ed Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable There is no purpose, it's just an edge case of the simple lexical speci= fication you can find at:
=C2=A0 http://caml.inria.fr/pub/docs/manual= -ocaml/lex.html#float-literal

Everywhere digits are allowed, you can insert extraneous underscores. T= here is no restriction that there must be at least one digit for underscore= s to be valid. I don't see why there should be.

On Wed, Feb 8, 2012 at 1:46 PM, Matej Ko=C5=A1=C3=ADk <= ;5764c029b688c1= c0d24a2e97cd764f@gmail.com> wrote:
Hi,

Ocaml allows me to add '_' at the end of a floating point literal, = e.g.:

=C2=A0 =C2=A0 =C2=A0 =C2=A01._

What can be a purpose for that?

In case of long or Long integers, optional adding of '_' between th= e
integer and 'l' or 'L' make sense ('l' is hard to d= iscriminate from '1'
for many fonts). But in case of floats, I am not sure.

--
Caml-list mailing list. =C2=A0Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


--0016e6d99a6dbca48704b87366ed--