The present invention concerns a device for conversion of a binary floating-point number into a binary fix-point 2-logarithm number or the opposite. This is done in the case of conversion of a binary floating-point number by making the invention include an input register where the floating-point number is stored, an output register for the calculated logarithm, a device that transfers the exponent of the floating-point number from the input register to the output register, where it directly forms the characteristic of the logarithm, a device that transfers the fractional part of the mantissa of the floating-point number from the input register to an adder and also to one or more part circuits that forms additional parts, a device that transfers the additional parts to the adder, said adder that adds the fractional part of the mantissa of the floating-point number and said additional parts and a device that transfers the sum from the adder to the output register where it forms the fractional part of 2-logarithm. Further, the part circuit or part circuits is arranged to be able to use different scale factors in different computing intervals. The conversion from a logarithm is carried out in a similar manner and with the same components.