Re: R-alpha: seq

George White (gwhite@cabot.bio.dfo.ca)
Wed, 4 Dec 96 13:49:00 AST


Message-Id: <199612041748.SAA14702@hypatia.math.ethz.ch>
From: George White <gwhite@cabot.bio.dfo.ca>
Subject: Re: R-alpha: seq
To: Kurt.Hornik@ci.tuwien.ac.at
Date: Wed, 4 Dec 96 13:49:00 AST
In-Reply-To: <199612041604.RAA25052@aragorn.ci.tuwien.ac.at>; from "Kurt Hornik" at Dec 4, 96 5:04 pm

> 
> >>>>> On Wed, 4 Dec 1996 07:44:42 -0600 (CST),
> >>>>> Douglas Bates <bates@stat.wisc.edu> said:
> 
> >>>>> "Peter" == Peter Dalgaard BSA <pd@kubism.ku.dk> writes:
> Peter> Well, that is obviously buggy and we need to find a fix for
> Peter> it before something will actually rely on .Machine$whatever.
> 
> [>] [...]
>
> > An alterative is to use the "volatile" keyword in the code for machar.
> > Values declared as volatile are supposed to be written to memory and
> > read back before they are used.  I'm not sure if this keyword only
> > exists in gcc or if it is part of ANSI C.

"volatile" is part of ANSI.  I'm not sure whether it actually has any
effect in some older compilers, but it is worth a try.  Probably the
same systems (I'm thinking of almost ANSI systems like Ardent/Stardent/KPC 
Titans) won't need it anyway.  

>  [...]
> `volatile' would be fine with gcc.  But it should really be the right
> thing to try using <values.h> and/or <float.h> first ... not sure how
> standardized these files are, though.
> 
I think it is worth the effort to ensure that machar will get the
right answers.  Runtime checks can help in detecting situations 
where something has broke. 

In particular, the IEEE rounding mode is sometimes different for the 
same binary run against different run-time libraries (I had this 
problem with a program compiled under OS/2 with emx-gcc and then
run under Windows with the RSX DOS extender, but I suspect it could
happen under linux as well).

We are going to see more and more reliance on dynamic loading, shared
libraries, and binary distribution or at least sharing of binaries on
networks.  Perhaps it would be a good idea for .Machine to store the
entries from <values.h> and <float.h> if available, and let the user know
if machar doesn't agree (this would likely turn up a few broken 
configurations!).

--
  George N. White III                | Internet: <aa056@chebucto.ns.ca>
  Department of Fisheries and Oceans | DFO email: GWhite@BIOnet.BIO.DFO.ca
  Ocean Sciences Division            | Time Zone: Atlantic (AST4ADT)
  Bedford Institute of Oceanography  | phone: (08:00-16:00)
  P.O. Box 1006                      |     902.426.8509 (office)
  Dartmouth, Nova Scotia             |     902.426.9388 (FAX)
  CANADA               B2Y 4A2       |     902.426.3793 (emergencies)

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- For info or help, send "info" or "help",
To [un]subscribe, send "[un]subscribe"
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-