Re: Distinguishing between characters and numbers



glen herrmannsfeldt wrote:
Dick Hendrickson wrote:
(snip)

I believe a plus or minus sign that is not followed by some
digits is an error.

10.6.1.2.1 F editing says
"The input field is either an IEEE exceptional specification or
consists of an optional sign, followed by a string of one or
more digits optionally containing a decimal symbol, including
any blanks interpreted as zeros."

In Fortran 66 formatted (before list directed) input, blanks were
considered as zeros. A completely blank field was a legal zero,
and I don't believe that a sign would have been illegal.

The last phrase on the quote above might only apply when
BLANK="ZERO" is used on the OPEN statement. If blanks are
interpreted as zero, input like +E and -E- should be legal
by the standard.


Blanks aren't interpreted as zero in list directed input. They're
value separators (unless they are in a character input string).

Also, 10.7.6 on the BN abd BZ edit descriptors says
"The blank interpretation mode affects only numeric editing (10.6.1)
and generalized numeric editing (10.6.4.1) on input."
Tracing back the references leads to the formatted edit
descriptors like I, F, G, etc. Not to list directed input.

Dick Hendrickson
I used to know calculators that would add a 1 if the EE
(enter exponent) key was pressed before any digits.
Convenient for entering powers of ten.

-- glen

.



Relevant Pages

  • Re: Interpretation of literal reals
    ... point is omitted the string of digits is right-justified ... when blanks are being treated as zeros. ... to make the blanks visible. ...
    (comp.lang.fortran)
  • Re: How to Force Field Size
    ... will not *store* leading zeros, ... Public Function LeftPadToLength(strVal As String, intLength As Integer, ... I have decided to change my numbers into the 10 digits ... >>End Sub ...
    (microsoft.public.access.modulesdaovba)
  • Re: Distinguishing between characters and numbers
    ... digits is an error. ... "The input field is either an IEEE exceptional specification or ... considered as zeros. ... A completely blank field was a legal zero, ...
    (comp.lang.fortran)
  • Re: new to java, help simple project
    ... array of digits in a number ... A constructor that uses a string representation of the integer for ... The string may contain leading zeros. ... ?public BigInt add ...
    (comp.lang.java.programmer)
  • Re: Cantors diagonal proof wrong?
    ... >> normal convention of leaving off the leading zeros (which we all ... > The positive integers are defined by the Peano axioms. ... The number of digits is a pure artifact of ... we can construct the string. ...
    (sci.math)