> Date: Tue, 14 Nov 2000 10:00:13 -0800
> From: Richard Maine <[log in to unmask]>
> Sure there are. But double precision doesn't help with that in any
> general sense. Double precision can do that only if the first kind
> was single precision. That's very restrictive. The kind syntax, on
> the other hand, can do that for arbitrary precisions, as long as the
> system supports the required precisions. We've seen examples here
> before. I'll probably mess it up off the top of my head, in which
> case I'm sure corrections will be given, but something like
>
> real(working_kind) :: x
> integer, parameter :: higher_kind = selected_real_kind(precision(x)+1)
>
> You might be able to get fancier and ask for a higher precision if
> available, settling for the same kind if it's already the highest,
> but I don't think I'll try the trick of writing that as an
> initialization expression. (Probably doable,
It's certainly "doable", and was covered in "Writing Portable Software"
in Fortran Forum, 1999.
> Richard Maine
> [log in to unmask]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|