Thread View: comp.std.c
3 messages
3 total messages
Started by Fred Tydeman
Fri, 15 Mar 1996 12:04
Valid floating-point constants ?
Author: Fred Tydeman
Date: Fri, 15 Mar 1996 12:04
Date: Fri, 15 Mar 1996 12:04
11 lines
904 bytes
904 bytes
I have run across some tools and compilers that do not like: 08.5 09. 09e0 They complain that those are invalid octal integers. I claim that they are valid decimal floating-point constants. Who is right? Fred Tydeman +49 (7031) 288-964 Tydeman Consulting Meisenweg 20 tydeman@netcom.com Programming, testing, C/C++ training 71032 Boeblingen /\old/\ \/new\/ Numerics editor of Jrnl. C Lang. Tran. Deutschland (Germany) tydeman@tybor.com Member of X3J11 (ANSI "C")
Re: Valid floating-point constants ?
Author: Larry Jones
Date: Fri, 15 Mar 1996 16:01
Date: Fri, 15 Mar 1996 16:01
16 lines
1129 bytes
1129 bytes
In article <4ibmd9$aq5@gate.seicom.net>, tydeman@tybor.com (Fred Tydeman) writes: > I have run across some tools and compilers that do not like: > > 08.5 09. 09e0 > > They complain that those are invalid octal integers. I claim > that they are valid decimal floating-point constants. Who is right? You are. Each of those should be parsed as a single pp-number preprocessing token which has the form of a floating-constant, not an octal-constant. There is nothing in the syntax or semantics that disallows leading zeros in floating-constants. ---- Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH 45150-2789 513-576-2070 larry.jones@sdrc.com ANY idiot can be famous. I figure I'm more the LEGENDARY type! -- Calvin
Re: Valid floating-point constants ?
Author: Norman Diamond
Date: Mon, 18 Mar 1996 03:26
Date: Mon, 18 Mar 1996 03:26
23 lines
1804 bytes
1804 bytes
In article <4ibmd9$aq5@gate.seicom.net>, tydeman@tybor.com (Fred Tydeman) writes: >I have run across some tools and compilers that do not like: > 08.5 09. 09e0 >They complain that those are invalid octal integers. I claim >that they are valid decimal floating-point constants. Who is right? Just to be snarky, you're both right :-) They are invalid octal integers but they are valid decimal floating-point constants :-) Now, the phrase "tools and compilers" suggests that you're not using something that is supposed to be a standard conforming C implementation. If the compiler is part of a complete C implementation, and the vendor asserts that the implementation conforms to the ISO or ANSI standard, *and* if you have obeyed the vendor's instructions on how to invoke the implementation in a conforming manner, then you should demand a refund from the vendor. However, if the tools are editors and other things that are not part of a C implementation or not asserted to be conforming, then the standard has nothing to say about them. -- << If this were the company's opinion, I would not be allowed to post it. >> "I paid money for this car, I pay taxes for vehicle registration and a driver's license, so I can drive in any lane I want, and no innocent victim gets to call the cops just 'cause the lane's not goin' the same direction as me" - J Spammer
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads