Method, implemented by a processor, of coding a real signal, for example an image signal, into a quantized signal, said method comprising the following steps applied to each real sample of said real signal: • converting (101) the real sample into a numerical representation, • selecting (102), from the fractional part of the number, a predetermined number N of most significant nonzero bits, • for each nonzero significant bit i selected, i varying from 1 to N, determining (103) its distance P, with respect to the neighbouring nonzero significant bit of higher rank selected or, for the first nonzero significant bit selected, with respect to the decimal point, • deducting (104) from said distance P, the minimum value of distance between two nonzero bits, • coding (106) the modified distance P, on a predetermined number M of bits.