[comp.std.c] scanf parsing

tada@athena.mit.edu (Michael J Zehr) (12/24/90)

what (if anything) does the ANSI spec say about scanf using %f format
and strtod for the following strings?

"1ea"
"1e "
"1e1e"

i've been surprised by a few results from VAXC recently, and i wonder
what the "right" answers are.

-michael

diamond@tkou02.enet.dec.com ("diamond@tkovoa") (12/24/90)

Subject: Re: scanf parsing
In article <1990Dec24.031228.5880@athena.mit.edu> tada@athena.mit.edu (Michael J Zehr) writes:
 
>what (if anything) does the ANSI spec say about scanf using %f format
>and strtod for the following strings?
 
>"1ea"
I believe that an interpretation ruling on this issue was posted a few
months ago, stating that the "a" would be pushed back, the "1" and "e"
are lost, and the result is matching failure.
 
>"1e "
.-1s/"a"/" "
 
>"1e1e"
This one does not seem to need interpretation.  1e1 is matched successfully
and the last "e" is pushed back.
 
--
Norman Diamond       diamond@tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.