Skip to content
Prev 6146 / 63421 Next

sum overflow (PR#1091)

Bill Simpson wrote:
It depends on the function you are using.

In your case you could use:
  as.double(sum(a*a)) * as.double(sum(b*b))

or just check if the result is double:
  is.double(sum(a*a))

Uwe Ligges
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._