Article View: comp.lang.c.moderated
Article #2522Re: Is 300F a valid float constant?
From: Lawrence Kirby
Date: Sat, 06 Apr 1996 14:41
Date: Sat, 06 Apr 1996 14:41
36 lines
1697 bytes
1697 bytes
In article <4jv7es$d2i@solutions.solon.com> rdwells@mmm.com writes:
>VC++ rejects 300F as a float constant, but my reading of
>the syntax part of section 6.1.3.1 of the standard indicates
>that it should be valid:
>
> 300 is a valid digit-sequence
> a digit-sequence alone is a valid fractional-constant
No, it isn't. In some copies of the standard (such as that in Schildt) there
is an error in that section. It should read:
fractional-constant
digit-sequence . digit-sequence
opt
digit-sequence .
Note the final . which is correctly stated in appendix B.1.4
...
>However, the description part of section 6.1.3.1 says:
>
> "...either the period or the exponent part shall be
> present"
>
>which would indicate to me that 300F is not valid.
300 can't be both a valid floating-constant and integer-constant or the
grammar would be ambiguous.
--
-----------------------------------------
Lawrence Kirby | fred@genesis.demon.co.uk
Wilts, England | 70734.126@compuserve.com
-----------------------------------------
Technical Details
Message-ID:
<4k5vqk$a0u@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4jv7es$d2i@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: Lawrence Kirby <fred@genesis.demon.co.uk> Newsgroups: comp.lang.c.moderated Subject: Re: Is 300F a valid float constant? Date: 6 Apr 1996 08:41:24 -0600 Organization: none Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4k5vqk$a0u@solutions.solon.com> References: <4jv7es$d2i@solutions.solon.com> Reply-To: fred@genesis.demon.co.uk NNTP-Posting-Host: solutions.solon.com X-NNTP-Posting-Host: genesis.demon.co.uk X-Newsreader: Demon Internet Simple News v1.27 X-Mail2News-Path: genesis.demon.co.uk