An example:
c1 = c2 = 2^-1022 // N
(* 2.22507*10^-308 *)
c1*c2
(* General::munfl warning *)
(* 0. *)
To suppress the underflow warning and replace the result by zero:
Quiet[c1*c2, General::munfl]
(* 0. *)
Or switch this message off globally:
Off[General::munfl];
c1*c2
(* 0. *)
Multiplying each number by $2^{512}$ fixes the underflow for sure. But then you may run into overflow issues on the other end. Here's a diagnostic multiplication function:
On[General::munfl];
mymult::stretch =
"underflow detected - please multiply both factors by at least `1`.";
mymult[a_?MachineNumberQ, b_?MachineNumberQ] :=
Quiet[
Check[a*b,
Message[mymult::stretch, 4*Exp[-512 Log[2] - (Log[a] + Log[b])/2]];
$Failed,
General::munfl],
General::munfl]
mymult[c1, c2]
(* mymult::stretch: underflow detected - please multiply both factors by at least 1.34`*^154. *)
(* $Failed *)
Maybe you could work with the logarithms of these numbers instead? This way you're much less likely to run into over-/underflow issues.
lc1 = Log[c1];
lc2 = Log[c2];
lc1 + lc2
(* -1416.79 *)