Complete floating point literals
Jacob Carlborg
doob at me.com
Sun Jul 10 02:28:46 PDT 2011
On 2011-07-09 21:13, bearophile wrote:
> This comes from a small sub-thread in D.learn (but I have asked for it the first time in bug 3837 time ago):
> http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=28030
>
> I suggest to turn floating point literals like the following into syntax errors (maybe just deprecated, so they get accepted using the -d compiler switch), because the saving of one digit is not worth the small troubles they cause now and then:
>
> .5
> 3.
>
> And require to write them like this:
>
> 0.5
> 3.0
>
> The enhancement request:
> http://d.puremagic.com/issues/show_bug.cgi?id=6277
>
> (Daniel Murphy suggests to allow 1.f and 1.L (and maybe .2f and .2L too) but I think this is a special case).
>
> (I think disallowing 3. is also useful if you want to allow the introduction of the .. or ... interval syntax. The trailing FP dot causes some troubles and asks for an extra space).
>
> What do you think?
>
> If I see enough people against this idea I will probably close the enhancement request.
>
> Bye,
> bearophile
Please kill this syntax. I don't think 1.f should be allowed. It would
still be a problem with UFCS, if we ever get that.
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list