printing internal values of intervals 
Author Message
 printing internal values of intervals

Someone recently noted that when Sun f95 prints an interval
value using a Z-edit descriptor, it fills the output field
with asterisks.  While this behavior does not violate either
the requirements of the fortran standard or Sun's documentation,
it is not as useful as one might hope.

Two competing changes to the behavior of Sun f95 have been
proposed.  The first is to print the interval in the form of
an interval, but with the lower and upper bounds printed as
the hexadecimal form of the internal value.  For example,
the program

      PROGRAM MAIN
        INTERVAL V
        V = [1.0, 2.0]
        PRINT '(Z35)', V
      END

would print

[3FF0000000000000,4000000000000000]

The other proposal is that the interval would be printed as two
separate values using two data edit descriptors.  For example, the
program

      PROGRAM MAIN
        INTERVAL V
        V = [1.0, 2.0]
        PRINT '(Z16)', V
      END

would print

3FF0000000000000
4000000000000000

Which form do you prefer?  Do you have a better proposal?

Bob Corbett



Fri, 28 Mar 2008 09:25:01 GMT  
 printing internal values of intervals


Quote:
> Someone recently noted that when Sun f95 prints an interval
> value using a Z-edit descriptor, it fills the output field
> with asterisks.  While this behavior does not violate either
> the requirements of the Fortran standard

I scanned the PDF version ofthe final committe draft of the
Fortran 2003 standard.  I was unable to locate the section
of the Standard that defines INTERVAL and the [...] syntax
used below.  What section should I be reading?

Quote:
>       PROGRAM MAIN
>         INTERVAL V
>         V = [1.0, 2.0]
>         PRINT '(Z35)', V
>       END

--
Steve
http://troutmask.apl.washington.edu/~kargl/


Fri, 28 Mar 2008 10:40:17 GMT  
 printing internal values of intervals
The Fortran standard does not define INTERVAL.  It does
define the [ ... ] syntax, but not for this context.  Thus,
whatever Sun f95 does in this regard does not violate
the requirements of the Fortran standard.

Sun's documentation does define INTERVAL, but it does
not specify what happens when a program attempts to
print an interval value using a Z-edit descriptor.

Bob Corbett



Fri, 28 Mar 2008 11:45:03 GMT  
 printing internal values of intervals

Quote:

>Someone recently noted that when Sun f95 prints an interval
>value using a Z-edit descriptor, it fills the output field
>with asterisks.  While this behavior does not violate either
>the requirements of the Fortran standard or Sun's documentation,
>it is not as useful as one might hope.

You didn't mention how intervals work with F descriptors. I'd think
that Z ought to be behave kind of like F: if F prints as [low, high]
then Z ought to print as [low, high]. Kind of like complex numbers.

-- greg



Fri, 28 Mar 2008 12:03:39 GMT  
 printing internal values of intervals

(snip)

Quote:
> Two competing changes to the behavior of Sun f95 have been
> proposed.  The first is to print the interval in the form of
> an interval, but with the lower and upper bounds printed as
> the hexadecimal form of the internal value.  (snip)
> [3FF0000000000000,4000000000000000]
> The other proposal is that the interval would be printed as two
> separate values using two data edit descriptors.  For example, the
> program

(snip)

Quote:
>         PRINT '(Z16)', V
> would print
> 3FF0000000000000
> 4000000000000000
> Which form do you prefer?  Do you have a better proposal?

What does COMPLEX do?

Normally complex needs two format descriptors for real numbers,
such as F, E, D, or G.    I do remember using COMPLEX with A format
in F66 days, where one variable would print with one format.

For F66 compilers that accepted Z or O, and allowed them
for REAL values, I believe used one descriptor for a COMPLEX variable,
though I am not sure about that.  It doesn't seem to be well documented.

If the sun compiler allows Z for COMPLEX, I believe it should do the
same for INTERVAL.  Otherwise, two format descriptors allows formatting
in any desired way, including the first form above.

-- glen



Fri, 28 Mar 2008 12:11:34 GMT  
 printing internal values of intervals
The way intervals are printed using an F-edit descriptor is beyond
human comprehension.  Suffice it to say that only one number is
written.

Bob Corbett



Fri, 28 Mar 2008 12:22:39 GMT  
 printing internal values of intervals
Complex values printed using Z-edit descriptors print as two
real values.  The program

      PROGRAM MAIN
        COMPLEX Z
        Z = (1.0, 2.0)
        PRINT '(Z16)', Z
      END

prints

3FF0000000000000
4000000000000000

Bob Corbett



Fri, 28 Mar 2008 12:27:52 GMT  
 printing internal values of intervals

Quote:

> Complex values printed using Z-edit descriptors print as two
> real values.  The program
>       PROGRAM MAIN
>         COMPLEX Z
>         Z = (1.0, 2.0)
>         PRINT '(Z16)', Z
>       END
> prints
> 3FF0000000000000
> 4000000000000000

As far as I can tell F2003 doesn't allow/require Z for real or complex
at all, but in any case for consistency, and because it is more general,
I vote the same for intervals.

-- glen



Fri, 28 Mar 2008 12:43:28 GMT  
 printing internal values of intervals
The Fortran standard does not allow real or complex
values to be written using integer edit descriptors.
The Fortran standard places no restrictions on what
a standard-conforming processor might do when
executing a program that is not standard conforming.
It places no restrictions whatever on processors that
are not standard-conforming.

Bob Corbett



Fri, 28 Mar 2008 12:52:48 GMT  
 printing internal values of intervals

Quote:

> The Fortran standard does not allow real or complex
> values to be written using integer edit descriptors.
> The Fortran standard places no restrictions on what
> a standard-conforming processor might do when
> executing a program that is not standard conforming.
> It places no restrictions whatever on processors that
> are not standard-conforming.

As neither Z with complex, nor interval are standard, it
doesn't seem that it needs to agree with the standard.

I wasn't so sure when I wrote it, but if sun supports
complex with Z and interval with Z it seems reasonable
to me that they agree.

-- glen



Fri, 28 Mar 2008 14:23:46 GMT  
 printing internal values of intervals

Quote:

> Someone recently noted that when Sun f95 prints an interval
> value using a Z-edit descriptor, it fills the output field
> with asterisks.  While this behavior does not violate either
> the requirements of the Fortran standard or Sun's documentation,
> it is not as useful as one might hope.

> Two competing changes to the behavior of Sun f95 have been
> proposed.  The first is to print the interval in the form of
> an interval, but with the lower and upper bounds printed as
> the hexadecimal form of the internal value.  For example,
> the program

>       PROGRAM MAIN
>         INTERVAL V
>         V = [1.0, 2.0]
>         PRINT '(Z35)', V
>       END

> would print

> [3FF0000000000000,4000000000000000]

This one confuses me becuase it prints two values on the
same line even though the format cracker sees an implied
"/" after the first value.

I'd try to model things more after complex output.
Because I think of an interval as a number pair, just like
I think of a complex number as a number pair.  People who
think a complex number is just a number will reach a
different conclusion.

People who use the Z format obviously want to see what the
bits are, so make them explicitly tell you how they want
to see them.  I'm assuming you have some sort of "interval"
descriptor that prints out intervals in a way not beyond the
bounds of human comprehension for normal use.

I think doing it the complex way is also consistent with
what F2003 is doing with structures.  If the programmer
simply puts a structure variable in an I/O list, it consumes
one format descriptor for each element in the structure.
If, instead, he goes to the trouble of using the defined
I/O mechanism, then he gets output explicitly tailored to
the type.  In a sense, I'd say an interval is like any other
derived type.  Use the interval descriptor, get nice output;
use the standard(?) descriptors and get pretty basic output.

Dick Hendrickson

- Show quoted text -

Quote:

> The other proposal is that the interval would be printed as two
> separate values using two data edit descriptors.  For example, the
> program

>       PROGRAM MAIN
>         INTERVAL V
>         V = [1.0, 2.0]
>         PRINT '(Z16)', V
>       END

> would print

> 3FF0000000000000
> 4000000000000000

> Which form do you prefer?  Do you have a better proposal?

> Bob Corbett



Fri, 28 Mar 2008 23:33:39 GMT  
 printing internal values of intervals


Quote:
> The Fortran standard does not define INTERVAL.  It does
> define the [ ... ] syntax, but not for this context.  Thus,
> whatever Sun f95 does in this regard does not violate
> the requirements of the Fortran standard.

> Sun's documentation does define INTERVAL, but it does
> not specify what happens when a program attempts to
> print an interval value using a Z-edit descriptor.

Thanks for the info.  Does Sun plan to pursue inclusion
of INTERVAL in the next revision (i.e, Fortran 2008)?

--
Steve
http://troutmask.apl.washington.edu/~kargl/



Sat, 29 Mar 2008 00:43:12 GMT  
 printing internal values of intervals

Quote:
> Does Sun plan to pursue inclusion
> of INTERVAL in the next revision (i.e, Fortran 2008)?

No.  I do not think we care to repeat the sad experience we had
when we tried to get intervals included in Fortran 2003.

Bob Corbett



Sat, 29 Mar 2008 08:14:28 GMT  
 printing internal values of intervals

Quote:
> This one confuses me becuase it prints two values on the
> same line even though the format cracker sees an implied
> "/" after the first value.

The run-time library routine for formatting interval values gets
the entire interval value at once.   It can choose to treat it as one
value or as two values.  In Sun f95, and I suspect most other
implementations, complex values are treated the same way,
except that the choice is always to treat the complex value as
two real values.

Quote:
> I'm assuming you have some sort of "interval"
> descriptor that prints out intervals in a way not beyond the
> bounds of human comprehension for normal use.

Yes, the V- and Y-edit descriptors.

As you might guess, I do not care for the way intervals
interact with the usual floating-point edit descriptors.  Sun has
shipped the product, and that interaction is documented; so,
barring an outcry from users, we are stuck supporting it as is.

Bob Corbett



Sat, 29 Mar 2008 12:14:16 GMT  
 printing internal values of intervals
Hi;
I definitively prefer the first proposal which is consistent with
mathematical representation of intervals. (I've experience with
interval calculations using emaulation software libraries -- not like
in Sun compilers)

Nobat (working for Hydro-Quebec)



Sun, 30 Mar 2008 20:56:34 GMT  
 
 [ 16 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Setting up an internal clock to take data acquisition at one minute intervals

2. Setting up an internal clock to take data acquisition at one minute intervals

3. 12TET Musical 3-Interval-String/6-Interval Cell/Set Non-Redundancy Permutation Ordering Problem:

4. How do I change internal value of PAGENO?

5. Initial values for internal RAM

6. valid values for internal file

7. Internal Files: convert numeric value to character form

8. Values of internal variables to and from file

9. printing two strings generated by internal write

10. code snippet to print tracebacks in internal format...

11. More J Questions : Printing intermediate values of y.

12. Not Printing the Decimal Values

 

 
Powered by phpBB® Forum Software