Best way to handle the ratio which cannot be represented as floating point numbers.

I need to calculate the ratio of the form:

$s=\sum _{1}^{3}{q}_{i}$, $\phantom{\rule{1em}{0ex}}$${p}_{i}=\frac{{q}_{i}}{\sum _{1}^{3}{q}_{i}}$

where ${q}_{i}>0$. One problem is that ${q}_{i}$ are too small that they can not represented as floating point numbers, then I can try logarithms ${z}_{i}=\mathrm{l}\mathrm{o}\mathrm{g}({q}_{i})$ and $\mathrm{l}\mathrm{o}\mathrm{g}({p}_{i})=\mathrm{l}\mathrm{o}\mathrm{g}({q}_{i})-\mathrm{l}\mathrm{o}\mathrm{g}({q}_{1}+{q}_{2}+{q}_{3})$, at this moment, I know $\mathrm{l}\mathrm{o}\mathrm{g}({q}_{1})=-2012,\mathrm{l}\mathrm{o}\mathrm{g}({q}_{2})=-2013,\mathrm{l}\mathrm{o}\mathrm{g}({q}_{3})=-2014$, but how to deal with $\mathrm{l}\mathrm{o}\mathrm{g}({q}_{1}+{q}_{2}+{q}_{3})$, any one could give me some idea?

thanks

I need to calculate the ratio of the form:

$s=\sum _{1}^{3}{q}_{i}$, $\phantom{\rule{1em}{0ex}}$${p}_{i}=\frac{{q}_{i}}{\sum _{1}^{3}{q}_{i}}$

where ${q}_{i}>0$. One problem is that ${q}_{i}$ are too small that they can not represented as floating point numbers, then I can try logarithms ${z}_{i}=\mathrm{l}\mathrm{o}\mathrm{g}({q}_{i})$ and $\mathrm{l}\mathrm{o}\mathrm{g}({p}_{i})=\mathrm{l}\mathrm{o}\mathrm{g}({q}_{i})-\mathrm{l}\mathrm{o}\mathrm{g}({q}_{1}+{q}_{2}+{q}_{3})$, at this moment, I know $\mathrm{l}\mathrm{o}\mathrm{g}({q}_{1})=-2012,\mathrm{l}\mathrm{o}\mathrm{g}({q}_{2})=-2013,\mathrm{l}\mathrm{o}\mathrm{g}({q}_{3})=-2014$, but how to deal with $\mathrm{l}\mathrm{o}\mathrm{g}({q}_{1}+{q}_{2}+{q}_{3})$, any one could give me some idea?

thanks