From p.dalgaard@biostat.ku.dk  Wed Oct 13 16:17:53 1999
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 13 Oct 1999 17:17:53 +0200
Subject: formatReal()-bug (or Is there anybody out there w/o IEEE754?)
In-Reply-To: Thomas Hoffmann's message of "Wed, 13 Oct 1999 15:58:38 +0200 (METDST)"
References: <199910131358.PAA06386@ehmgs2.et.tu-dresden.de>
Message-ID: <x2so3f8f31.fsf@blueberry.kubism.ku.dk>

Thomas Hoffmann <hoffmann@ehmgs2.et.tu-dresden.de> writes:

> On a system with IEEE_754 undefined, I run into an bug, when the value
> of an element of the first argument (e.g., x[0]) of formatReal() is NA:
> 
> 1. (format.c:235) if (!R_FINITE ..) gives nanflag=1 (!naflag remains 0)
> 2. (format.c:272..288) *m gets an value of -2147483643 (from the format 
>                        fiddling, should not matter to us)
> 3. (format.c:289) because naflag is zero, m does not get the value of
>                   R_print.na_width and we get back the unbelievable value 
>                   from 2.
> 
> This crashes R in commands as 
> 	as.vector(NA,mode="double")
> .

If a system isn't IEEE, it might not know about NaN either, so I
suspect that one wants naflag = 1 rather than nanflag = 1.

Could you try it and report back?

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


formatReal()-bug (or Is there anybody out there w/o IEEE754?)
Peter Dalgaard BSA