> Hi,
>
> Some of the problem is with floating-point literals. What if the
> spec were to say that if a literal does not have a KIND specified,
> it is to be interpreted as the "greatest" kind that the implementation
> supports (rather than the default kind)?
>
> For instance, in "REAL a; a= 1./7.", 1. and 7. might be interpreted
> as, say, DOUBLE PRECISION constants.
>
> It seems to me that this simple proposal would solve a lot of gotchas
> that arise when, say, you want to take old code with an expression
> such as the above and make "a" DOUBLE PRECISION instead.
Yes, but it introduces new problems when there is no obvious
way to correct a "mistake" do to this promotion.
Things like
call expects_a_single_precision_arg (3.14)
or
call expects_a_single_precision_arg (3.14*single_prec_variable)
or
single_prec = max(single_prec, 1.0)
For good or for bad, Fortran has a ton of rules about what types
can be used where and what the results of mixed type operations
are, and trying to change (or even improve) them will make old
programs fail in strange ways.
Dick Hendrickson
>
> -P.
>
> --
> Peter S. Shenkin Schrodinger, Inc.
> VP, Software Development 120 W. 45th St., 32nd Floor
> 646 366 9555 x111 Tel New York, NY 10036
> 646 366 9550 FAX USERID: shenkin
> http://www.schrodinger.com DOMAIN: schrodinger DOT com
> Pre-arranged conf. calls: 702-759-8420 or 888-867-7084; passcode 646-366
|