Re: A newbie question
ayagnam_at_gmail.com
Date: 01/28/05
- Next message: ayagnam_at_gmail.com: "Re: A newbie question"
- Previous message: Oyvind Sylta: "Re: Fortran90 BIT manipulation ?"
- Maybe in reply to: sali0090_at_tc.umn.edu: "Re: A newbie question"
- Next in thread: ayagnam_at_gmail.com: "Re: A newbie question"
- Reply: ayagnam_at_gmail.com: "Re: A newbie question"
- Reply: David Ham: "Re: A newbie question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Jan 2005 01:05:16 -0800
Howard Salis wrote:
> zwang5@hotmail.com (anoy69) wrote in message
news:<5e3322f.0311192231.4e71c910@posting.google.com>...
> > Hello,
> >
> > I am trying to understand somebody's code. In particular, I have
> > trouble to understand the following:
> > DATA A / 2.0D0, 3*8D8, 1.0D0, 2.0D0, 2*8D8, 0.0D0, 1.0D0,
> >
> > $ 2.0D0, 8D8, 0.0D0, 0.0D0, 1.0D0, 1.0D0 /
> >
> > What are these numbers? I know 0.0D0=0, but what about 8D8?
> >
> > Thanks,
> >
> > Zhu
>
> You can save yourself a big headache if you use Fortran90's method of
> determing type.
>
> In declarations:
>
> <Type> :: <list of vars>
> <Type> = Integer, Integer*4, Real*4, Real*8, Real*16, etc
> Integer/Integer*4 = single/double precision integer
> Real*4/Real*8/Real*16 = single/double/triple precision floating
number
>
> Triple real precision isn't supported with some compilers.
>
> So using standard engineering formats..
>
> Real*8 :: number
>
> number = 1e-8 * 1e16 / 2.0 + 4e3 + 1 - sqrt(2)
>
> number is double precision.
>
> 1e-8 is double precision
> sqrt(2) uses the overloaded double precision sqrt
> 1 is represented as 1.0 in compilation
>
> This assumes a reasonably smart compiler. If you have a stupid
> compiler, you can put real(<constant, var>,<precision>) around any
> variable or number to force the compiler to represent the number as
> that type.
>
> real(1,16) is triple real precision.
>
> I never did like the whole 'd' thing in F77.
>
> Howard Salis
- Next message: ayagnam_at_gmail.com: "Re: A newbie question"
- Previous message: Oyvind Sylta: "Re: Fortran90 BIT manipulation ?"
- Maybe in reply to: sali0090_at_tc.umn.edu: "Re: A newbie question"
- Next in thread: ayagnam_at_gmail.com: "Re: A newbie question"
- Reply: ayagnam_at_gmail.com: "Re: A newbie question"
- Reply: David Ham: "Re: A newbie question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]