I need to calculate a list of very small numbers such as
(0.1)^1000, 0.2^(1200),
and then normalize them so they will sum up to one i.e.
a1 = 0.1^
The Brobdingnag package deals with very large or small numbers, essentially wrapping Joris's answer into a convenient form.
a1 <- as.brob(0.1)^1000 a2 <- as.brob(0.2)^1200 a1_dash <- a1 / (a1 + a2) a2_dash <- a2 / (a1 + a2) as.numeric(a1_dash) as.numeric(a2_dash)