Hello everybody,

I have to compute something in this form:

x = prod(a:b) / prod(c:d),    where: a < c and b < d and obviously: a
< b and c < d

I cannot make assumptions on the relative position of c,b and a,d.

The problem is that a,b,c,d are large and the products are huge (R return Inf).
Their ratio is less than 1 but significantly higher than 0: it is a
non-tiny probability.

I need to find a way to simplify this ratio.
The only way to solve this that I see is to decompose into prime
factors all the
numbers in the numerator and the denominator and to remove the ones in common

Do you know a better way to do this ?

Thank you,
Alberto

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to