IEEE 754 Style Arithmetic

Ross Ihaka
Wed, 7 Jan 1998 12:51:15 +1300 (NZDT)

I have been looking at the R mathematical library with a view to
making changes so that it will handle IEEE 754 entities like NaN and
+/- Inf.  This appears to be not too hard and I am fairly well down
the path to converting the existing code (and simultaneously
converting some of the more suspect algorithms to something more


I have looked at the Splus implementation and I have a bit of a
problem with some of the decisions that have been made.  For example

	pnorm(0, 1, Inf)   ->   0.5

This seems VERY dangerous to me.  It's the kind of thing which could
make errors almost impossible to find.  I would much rather that this
generated NaN (it's a domain error in my view).

There are some other nits like this too.  Would it be a serious
problem if I were to "fix" these?


At present, the functions returning information about discrete
distributions work on integer (32-bit C int) arguments.  This limits
the domain for these functions.  Has anyone found that that this is a

r-devel mailing list -- Read
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: