Re: IMPLICIT NONE (F2k8+/-)



Ryo wrote:
Dan Nagle wrote:
[...]

Do you want math_pi as a bit pattern in memory (64 bits) rounded
to full precision, or as the result given by an intrinsic (which one?)
or as the precision of pi in register (say, 80 bits), or the result
of reading the digits of pi from a file (with which rounding mode?),
etc.

It rather depends on the purpose to which you intend to use pi,
I think.

One way to make pi yourself, and any other constants you want,
is to compute them however you will, and write the results
to a module source file.  Compile the file and use it with your
programs.  That way, you get the definition you want.


This logic would lead us to conclude that we'd better omit
random_number from the standard, for example.  Which kind of
random numbers do you want?  Roll your own random number generator.
And I think people do, when they care about the quality of
random numbers.  That way, you get the definition you want. . . .

I think that if the need is common (as it is for pi), it's better
to have *something* than nothing.  If/When you care about the quality
of the constant, you'd roll your own definition of pi.

This is my very own opinionated point of view, but if/when you *don't* care about the quality of the constant, you shouldn't be doing any serious programming (and by serious i mean crunching numbers where the impact can affect peoples lives, i.e. lost wages, bad forecasts, death..). The "something is better than nothing" argument also translates to "good e-bloody-nough" (or the pejorative "good enough for government work") method of programming. Things like poorly defined constants that seem to work in test codes may cause weirdnesses in operational use ... or they may not.


If people can't be bothered to ensure their constants are defined to enough precision (or the correct way, or whatever), then they should use IDL or matlab which has all that stuff built in (correctly or no for your application). I'm sick and tired of fixing code from people who's attitude when it comes to programming is that of "pi=3.14 is good enough". Hell, even if I see
real, parameter :: pi = 3.14159
in code I know I'm going to lose at least a couple of days of my life checking and fixing code.


O.k., I'm done ranting. :o)

A second issue is, where does the list of constants stop?
I presume e, the golden ratio, ... ?
Why not (one over the square root of two pi) ?

Again, does that mean that having nothing is better than having some? If you are talking about the difficutly in getting agreement within the standardization committee, then I guess you may be right (I can only guess, though). But, for ordinary users, it's better to have some of the most common ones like pi than not to have any.

What's an "ordinary" user?

cheers,

paulv

--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
.



Relevant Pages

  • software thuriam
    ... We have been using state-of-the-art Quality Assurance ... can manage from DESKTOP or NETWORK programming for large organization ... Accounting Software, Small Business Accounting Software, Business ... Development, Software Project Recovery, Database Development and ...
    (comp.sys.mac.advocacy)
  • software thuriam
    ... We have been using state-of-the-art Quality Assurance ... can manage from DESKTOP or NETWORK programming for large organization ... Accounting Software, Small Business Accounting Software, Business ... Development, Software Project Recovery, Database Development and ...
    (comp.sys.mac.advocacy)
  • software thuriam
    ... We have been using state-of-the-art Quality Assurance ... can manage from DESKTOP or NETWORK programming for large organization ... Accounting Software, Small Business Accounting Software, Business ... Development, Software Project Recovery, Database Development and ...
    (comp.sys.mac.advocacy)
  • software thuriam
    ... We have been using state-of-the-art Quality Assurance ... can manage from DESKTOP or NETWORK programming for large organization ... Accounting Software, Small Business Accounting Software, Business ... Development, Software Project Recovery, Database Development and ...
    (comp.sys.mac.advocacy)
  • software thuriam
    ... We have been using state-of-the-art Quality Assurance ... can manage from DESKTOP or NETWORK programming for large organization ... Accounting Software, Small Business Accounting Software, Business ... Development, Software Project Recovery, Database Development and ...
    (comp.sys.mac.advocacy)