Finding genes for complex traits is one of the major challenges of modern human genetics. Current developments of molecular techniques facilitated use of large pedigrees and marker sets of thousands of single-nucleotide polymorphisms (SNPs). However, one of the problems occurring in statistical analysis of such large data sets is that the likelihood is very low and underflow may easily occur. In this work we describe a method permitting to avoid underflow during computation of a likelihood function, using different algorithms. Our method makes practically possible analysis of thousands of individuals and thousands of SNPs. The method is easy to implement without major change of the code of existing programs. It also helps to reduce the amount of computer memory used in analysis without noticeable alteration of the program running time. The algorithm was implemented in the software packages for segregation and linkage analysis, which are available from http://mga.bionet.nsc.ru/.