Re: Is it time to legitimise REAL*8 etc?



Richard Maine wrote:
Paul van Delst <Paul.vanDelst@xxxxxxxx> wrote:

Could someone explain to me the cumbersomeness of
SELECTED_REAL(INT)_KIND() ??
I agree the syntax is a bit wordy,

Yes, that's one thing - one that I think is more important than you make
it out to be. Another is that it just doesn't match the way most people
want/need to specify things. Decimal digits of precision might seem fine
in theory, but that just isn't a good match the reality of programming.
When what you want to do is select between the 32-, 84- and 128-bit
options for real, it is cumbersome to translate that into numbers of
decimal digits.

O.k., I understand what people take issue with. The interface to people's perceptions is ass-about, but you grapple with the strangeness up front and only once, right? I think the first piece of f90 code I wrote (back in '95) was my Type_Kinds.f90 module that contained definitions for these things (True, I have a test program that output my type kinds results). I've hardly thought about it since then... I just use it. If I want single precision (==real*4) I do
REAL(Single) :: x
or
REAL(sp) :: x
and if I want double (==real*8) I do
REAL(Double) :: x
or
REAL(dp) :: x

(similarly for ints)

It has worked on all platforms I've had access to so far: Sun Solaris, SGI-IRIX, IBM-AIX, HP-UX, PC(linux using pgi, intel, lahey, gfortran, g95), and Macs (intel,gfortran,g95). I definitely do not attribute that portability to my skill as a programmer but to the construct itself.

I mean, if you want to measure the length of various things, you don't construct a brand new measuring stick every time - you get a good one up front and reuse it until you wear it out.

cheers,

paulv

.



Relevant Pages

  • Re: Gentler Decimal Floating-Point
    ... or really to specify decimal arithmetic. ... that the range, precision, or scale factor is specified in decimal ... precision in decimal digits for binary arithmetic. ... The language rules specify how those conversions are to be ...
    (comp.arch.arithmetic)
  • Re: Is it time to legitimise REAL*8 etc?
    ... Decimal digits of precision might seem fine ... but that just isn't a good match the reality of programming. ... If selected_real_kind asked about binary instead of decimal precision, ... be they decimal or binary digits. ...
    (comp.lang.fortran)
  • Re: Is it time to legitimise REAL*8 etc?
    ... want/need to specify things. ... Decimal digits of precision might seem fine ... I was wishing I had used "obtuseness" as opposed to simply cumbersome as it is what I find particularly the most difficult issue, ...
    (comp.lang.fortran)
  • Re: Precision issue with Float and Double (C++)
    ... If you are having problems with "decimal precision", ... numeric programming if you are doing serious numeric programming, ... use calculators for exams. ... doing what were called "mesh" computations, and one of the classic problems, as it was ...
    (microsoft.public.vc.mfc)
  • Re: IMPLICIT NONE (F2k8+/-)
    ... to full precision, or as the result given by an intrinsic or as the precision of pi in register, or the result of reading the digits of pi from a file, etc. ... If/When you care about the quality ... you shouldn't be doing any serious programming (and by serious i ... I'm sick and tired of fixing code from ...
    (comp.lang.fortran)