my @bigfloats = ([6, '1.234e56', '1e50'], [12, '2.3456e789', '1e777'], # "lorem ipsum ..." [18, '3.45678e9012', '1e8994'], [36, '4.567890e12345', '1e12329']); # Each of the above arrays has (0) the number of decimal digits of precision needed, # (1) a number near the large end of the range for a type, # (2) a number near epsilon for the sample number (1) my $prec = 0; foreach my $step (@bigfloats) { $prec = $step->[0]; my $num = (0+$step->[1]); my $sum = ($num + $step->[2]); last unless $num eq $step->[1] and $sum > $num; } $defines .= ' -DLU_NV_PREC='.$prec;