implemented operations on q-format numbers