Constant precision & type/precision promotion 
Author Message
 Constant precision & type/precision promotion

As I understand it the rules are: that in expressions the lower precision
type is converted to the higher precision type i.e. I short -> I long ->
real -> double precision -> quad precision  etc.  before combining with
a higher precision quantity. That in assignments the rhs result is converted
to to the lhs variable type. That constants are initally assigned default
type precisions (unless explicityly typed, e.g. .1D+00, which can only be
done for real types/components).
However it seems to me that for constants the rule could have been
That constants are initially assigned the maximum precision for their class,
and converted down to the precision of whatever variable they are being
combined with or assigned to.
What are the reasons that the standards commitees decided on the former
rather than the latter set of rules?
Please copy me via e-mail on any follow-ups: as our news expires very
quickly, and lots gets lost before it gets here.
--Rostyk
--Rostyk


Sat, 07 Mar 1998 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Convert single precision to double precision

2. Internal Precision Vs. Unformatted Precision

3. HP Fortran question: precision of double-precision?

4. double precision vs. single precision

5. single precision or double precision?

6. Double precision runs fast tan single precision in MS Fortran

7. Converting real constants to double precision

8. Kinds, precision and constants

9. CRAY-YMP single precision machine constants.

10. precision of constants

11. Precision of Floating Point Types

12. high-precision type

 

 
Powered by phpBB® Forum Software