Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion ? How to have a FORTRAN function emulate flops for desired digits
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Richard Maine  
View profile  
 More options Sep 6 2000, 5:14 pm
Newsgroups: comp.lang.fortran
From: Richard Maine <ma...@altair.dfrc.nasa.gov>
Date: 06 Sep 2000 14:07:30 -0700
Local: Wed, Sep 6 2000 5:07 pm
Subject: Re: ? How to have a FORTRAN function emulate flops for desired digits

Cheng Cosine <acos...@yahoo.com> writes:
> Would you give some examples about other precisions that some compilers
> can offer other than the standard IEEE SP/DP?

Whatever the machine offers.  Some support the IEEE 80-bit and 128-bit
formats.  Then there are the VAX formats.  And the IBM mainframe ones.
And the Cray ones.  That's all among machines currently in fairly
common use.  No need to even bring up the old CDC 60-bit formats,
and the 36- and 48-bit formats used on some other old machines - you
aren't likely to find f90 compilers on those machines (you'd have a
hard enough time finding the machines at all).

The IEEE formats are certainly the most common on current machines,
but they aren't universal.  I'm a little puzzled by your even asking.
Seems to me that you (correctly) gave two examples yourself in...

> From what I learned from some numerical analysis books, the
> floating point system is machine dependent. Say there are other
> system used in Cray and IBM mainframe that are other than the
> IEEE SP/DP system.

Yes, those are two of the examples.

> > > Single precision has 6 significant digits
> > > while double precision has 16.
> > That depends on the compiler.  These values are not correct for all compilers.
> For Lahey FORTRAN, that seems to be. Can you give the values for other compilers?

Frankly not worth my trouble.  See first para.  The 64-bit systems like the
Crays are likely to have numbers more like the 16 for single precision and
something bigger (I don't know what) for double.

> I know that declaration [selected_real_kind], but that is not what I
> want.  I'd like to show my student about how limited significant
> digits can effect the flops. So I need exectly 3, 4, or 10, or
> whatever digits that the hardware does not support though.

I'm not sure how significant digits effect flops (perhaps I need to
take your course - I thought a flop was a floating point operation in whatever
precision it was in), but in any case..

If the hardware doesn't support it, then the compiler isn't likely to
either.  Its certainly possible in principle, but it's really quite a
big job.  A compiler vendor is unlikely to take that on without
substantial incentive (i.e. lots of sales dependent on it).

>   Can you give me a FORTRAN90 code as an example?

No way.  Its also a big job to do as a user.  Perhaps someone might have
already done such a thing that they are willing to share.  That's possible.
But there's no way I'm likely to try to do it as an answer to a usenet
posting.  You'd have to go through and define each operation (including
extensions of any intrinsics that you wanted to use).  As long as the
precision you wanted was less than the max hardware-supported one,
it would probably be easiest to use the hardware-supported operations
and then truncate the results.

You could look at Walt's big_integer (or however its spelled) module for
an example of how to define operations for a custom numeric type.  But
I'm afraid a floating point one would be harder.  If you are just looking
for something to use for illustration in a course, then I'd guess the
investment required would be far too high unless someone already has
something you could use.  (If someone does, perhaps they'll reply in this
thread - I don't).

--
Richard Maine
ma...@altair.dfrc.nasa.gov


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.