[R] Single precision

Prof Brian D Ripley ripley at stats.ox.ac.uk
Mon Aug 30 15:02:13 CEST 1999


On Mon, 30 Aug 1999, Carlos Corral van Damme wrote:

>     I am trying to port a huge Fortran routine that has been written
> using type Real (single precision) instead of Real*8. R works only with
> double precision and I got absurd results when calling the routine. Is
> it possible to make it work properly without changing the source code?
>     I am running V0.64.1 of R for Unix.

Well, first we suggest you upgrade to 0.65.0.

It depends what `Unix' is. You may be able to tell the compiler to
use double precision, for example by -r8 -i4 on a SunPro compiler.
However, if this is really one huge routine, just put

    implicit double precision (a-h, o-z)

in the declarations section, change any explicit real declarations to
double precision, and check out uses of real(), probably changing them to
dble().


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list