Some kinds of digital signals such as medical images are required to be compressed in a lossless or nearly lossless manner. This paper describes a lossless and nearly lossless conversion with orthogonal transforms which are usually used to perform data compression in a lossy manner. It is assumed that forward and inverse transforms are carried out without producing any errors. The coefficients obtained by forward transform are truncated in floating-point format. Their errors due to finite precision are analyzed, and precision of coefficients necessary to limit errors of reconstructed signals in a given range is derived. The case of the one-dimensional discrete cosine transform in studied.